$treeview $search $mathjax
Stratagus  2.2.6
$projectbrief
$projectbrief
$searchbox
-->
         _________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
           Stratagus - A free fantasy real time strategy game engine

src/video/video.cpp File Reference

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "stratagus.h"
#include <vector>
#include "video.h"
#include "font.h"
#include "ui.h"
#include "cursor.h"
#include "iolib.h"
#include "map.h"
#include "intern_video.h"
#include "SDL.h"

Classes

struct  Clip
class  ColorIndexRange
class  CColorCycling

video.cpp - The universal video functions.

CVideo Video
 Do SDL hardware unlock.
char ForceUseOpenGL
bool UseOpenGL
char VideoForceFullScreen
 Use OpenGL.
unsigned long NextFrameTicks
 fullscreen set from commandline
unsigned long FrameCounter
 Ticks of begin of the next frame.
int SlowFrameCounter
 Current frame number.
int ClipX1
 Profile, frames out of sync.
int ClipY1
 current clipping top left
int ClipX2
 current clipping top left
int ClipY2
 current clipping bottom right
static std::vector< ClipClips
 current clipping bottom right
int VideoSyncSpeed = 100
int SkipFrames
 0 disable interrupts
Uint32 ColorBlack
 Skip this frames.
Uint32 ColorDarkGreen
Uint32 ColorBlue
Uint32 ColorOrange
Uint32 ColorWhite
Uint32 ColorGray
Uint32 ColorRed
Uint32 ColorGreen
Uint32 ColorYellow
void InitVideoSdl ()
void SdlLockScreen ()
 Init SDL video hardware driver.
void SdlUnlockScreen ()
 Do SDL hardware lock.
void SetClipping (int left, int top, int right, int bottom)
void PushClipping ()
 Push current clipping.
void PopClipping ()
 Pop current clipping.
unsigned long GetTicks ()
 Returns the ticks in ms since start.
void InitVideo ()
 initialize the video part
void DeInitVideo ()
 deinitliaize the video part
void VideoPaletteListAdd (SDL_Surface *surface)
void VideoPaletteListRemove (SDL_Surface *surface)
void ClearAllColorCyclingRange ()
void AddColorCyclingRange (unsigned int begin, unsigned int end)
void SetColorCycleAll (bool value)
static void ColorCycleSurface (SDL_Surface &surface)
void ColorCycle ()
 Does ColorCycling..

Defines

#define COLOR_CYCLE_SPEED   (CYCLES_PER_SECOND / 4)

Define Documentation

#define COLOR_CYCLE_SPEED   (CYCLES_PER_SECOND / 4)


Function Documentation

void AddColorCyclingRange ( unsigned int  begin,
unsigned int  end 
)

void ClearAllColorCyclingRange (  ) 

void ColorCycle (  ) 

Does ColorCycling..

Color cycle.

MACRO defines speed of colorcycling FIXME: should be made configurable

static void ColorCycleSurface ( SDL_Surface &  surface  )  [static]

Color Cycle for particular surface

void DeInitVideo (  ) 

deinitliaize the video part

unsigned long GetTicks (  ) 

Returns the ticks in ms since start.

Return ticks in ms since start.

void InitVideo (  ) 

initialize the video part

Video initialize.

void InitVideoSdl (  ) 

Initialize the video part for SDL.

void PopClipping (  ) 

Pop current clipping.

Pop current clipping.

void PushClipping (  ) 

Push current clipping.

Push current clipping.

void SdlLockScreen (  ) 

Init SDL video hardware driver.

Lock the screen for write access.

void SdlUnlockScreen (  ) 

Do SDL hardware lock.

Unlock the screen for write access.

void SetClipping ( int  left,
int  top,
int  right,
int  bottom 
)

Set clipping for graphic routines.

Parameters:
left Left X screen coordinate.
top Top Y screen coordinate.
right Right X screen coordinate.
bottom Bottom Y screen coordinate.

void SetColorCycleAll ( bool  value  ) 

void VideoPaletteListAdd ( SDL_Surface *  surface  ) 

Add a surface to the palette list, used for color cycling

Parameters:
surface The SDL surface to add to the list to cycle.

void VideoPaletteListRemove ( SDL_Surface *  surface  ) 

Remove a surface to the palette list, used for color cycling

Parameters:
surface The SDL surface to add to the list to cycle.


Variable Documentation

std::vector<Clip> Clips [static]

current clipping bottom right

int ClipX1

Profile, frames out of sync.

int ClipX2

current clipping top left

int ClipY1

current clipping top left

int ClipY2

current clipping bottom right

Uint32 ColorBlack

Skip this frames.

Editor callbacks.

Uint32 ColorBlue

Uint32 ColorGray

Uint32 ColorGreen

Uint32 ColorOrange

Uint32 ColorRed

Uint32 ColorWhite

Uint32 ColorYellow

unsigned long FrameCounter

Ticks of begin of the next frame.

Counts frames.

unsigned long NextFrameTicks

fullscreen set from commandline

Next frame ticks.

0 disable interrupts

Current frame number.

Counts quantity of slow frames.

bool UseOpenGL

Do SDL hardware unlock.

Use OpenGL.

Fullscreen or windowed set from commandline.

int VideoSyncSpeed = 100

Video synchronization speed. Synchronization time in percent. If =0, video framerate is not synchronized. 100 is exact CYCLES_PER_SECOND (30). Game will try to redraw screen within intervals of VideoSyncSpeed, not more, not less.

See also:
CYCLES_PER_SECOND

(C) Copyright 1998-2011 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.