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

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
graphic.cpp File Reference
#include "stratagus.h"
#include <string>
#include <map>
#include <list>
#include "video.h"
#include "player.h"
#include "intern_video.h"
#include "iocompat.h"
#include "iolib.h"
#include "ui.h"

graphic.cpp - The general graphic functions.

static int HashCount
 
static std::map< std::string,
CGraphic * > 
GraphicHash
 
static std::list< CGraphic * > Graphics
 
static void ApplyGrayScale (SDL_Surface *Surface, int Width, int Height)
 
static void FreeSurface (SDL_Surface **surface)
 
void FreeOpenGLGraphics ()
 Free OpenGL graphics. More...
 
void ReloadGraphics ()
 Reload OpenGL graphics. More...
 
static int PowerOf2 (int x)
 
static void MakeTextures2 (CGraphic *g, GLuint texture, CUnitColors *colors, int ow, int oh)
 
static void MakeTextures (CGraphic *g, int player, CUnitColors *colors)
 
void MakeTexture (CGraphic *g)
 Make an OpenGL texture. More...
 
void LazilyMakeColorCyclingTextures (CGraphic *g, std::vector< ColorIndexRange > ranges)
 Make OpenGL textures for color cycling. More...
 
void MakeColorCyclingTextures (CGraphic *g, int count)
 
void MakePlayerColorTexture (CPlayerColorGraphic *g, int player)
 Make an OpenGL texture of the player color pixels only. More...
 
void FreeGraphics ()
 

Function Documentation

static void ApplyGrayScale ( SDL_Surface *  Surface,
int  Width,
int  Height 
)
static
void FreeGraphics ( )
void FreeOpenGLGraphics ( )

Free OpenGL graphics.

Free OpenGL graphics

static void FreeSurface ( SDL_Surface **  surface)
static

Free a SDL surface

Parameters
surfaceSDL surface to free
void LazilyMakeColorCyclingTextures ( CGraphic g,
std::vector< ColorIndexRange ranges 
)

Make OpenGL textures for color cycling.

void MakeColorCyclingTextures ( CGraphic g,
int  count 
)
void MakePlayerColorTexture ( CPlayerColorGraphic g,
int  player 
)

Make an OpenGL texture of the player color pixels only.

Make an OpenGL texture with the player colors.

Parameters
gThe graphic to texture with player colors.
playerPlayer number to make textures for.
void MakeTexture ( CGraphic g)

Make an OpenGL texture.

Make an OpenGL texture or textures out of a graphic object.

Parameters
gThe graphic object.
static void MakeTextures ( CGraphic g,
int  player,
CUnitColors colors 
)
static

Make an OpenGL texture or textures out of a graphic object.

Parameters
gThe graphic object.
playerPlayer number.
colorsUnit colors.
static void MakeTextures2 ( CGraphic g,
GLuint  texture,
CUnitColors colors,
int  ow,
int  oh 
)
static

Make an OpenGL texture or textures out of a graphic object.

Parameters
gThe graphic object.
textureTexture.
colorsUnit colors.
owOffset width.
ohOffset height.
static int PowerOf2 ( int  x)
static

Find the next power of 2 >= x

void ReloadGraphics ( )

Reload OpenGL graphics.

Reload OpenGL graphics

Variable Documentation

std::map<std::string, CGraphic *> GraphicHash
static
std::list<CGraphic *> Graphics
static
int HashCount
static
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.