$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
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "stratagus.h"
#include <vector>
#include "video.h"
#include "sound.h"
#include "unitsound.h"
#include "editor.h"
#include "unittype.h"
#include "player.h"
#include "unit.h"
#include "tileset.h"
#include "map.h"
#include "construct.h"
#include "cursor.h"
#include "interface.h"
#include "font.h"
#include "ui.h"
#include "script.h"
Classes | |
class | Decoration |
class | DecoSpriteType |
unit_draw.cpp - The draw routines for units. | |
static DecoSpriteType | DecoSprite |
unsigned long | ShowOrdersCount |
All sprite's infos. | |
void(* | DrawSelection )(Uint32 color, int x1, int y1, int x2, int y2) = DrawSelectionNone |
Show orders for some time. | |
const CViewport * | CurrentViewport |
Config: reveal attacker enabled. | |
static int | s_min (int a, int b) |
static int | s_max (int a, int b) |
void | DrawUnitSelection (const CViewport *vp, const CUnit &unit) |
FIXME: quick hack for split screen. | |
void | DrawSelectionNone (Uint32, int, int, int, int) |
Draw nothing around unit. | |
void | DrawSelectionCircle (Uint32 color, int x1, int y1, int x2, int y2) |
Draw circle around unit. | |
void | DrawSelectionCircleWithTrans (Uint32 color, int x1, int y1, int x2, int y2) |
Draw circle filled with alpha around unit. | |
void | DrawSelectionRectangle (Uint32 color, int x1, int y1, int x2, int y2) |
Draw rectangle around unit. | |
void | DrawSelectionRectangleWithTrans (Uint32 color, int x1, int y1, int x2, int y2) |
Draw rectangle filled with alpha around unit. | |
void | DrawSelectionCorners (Uint32 color, int x1, int y1, int x2, int y2) |
Draw corners around unit. | |
int | GetSpriteIndex (const char *SpriteName) |
static int | CclDefineSprites (lua_State *l) |
void | DecorationCclRegister () |
Register CCL decorations features. | |
void | LoadDecorations () |
Load the decorations (health,mana) of units. | |
void | CleanDecorations () |
Clean the decorations (health,mana) of units. | |
void | UpdateUnitVariables (const CUnit &unit) |
Update custom Variables with other variable (like Hp, ...). | |
static void | DrawDecoration (const CUnit &unit, const CUnitType *type, int x, int y) |
void | DrawShadow (const CUnitType &type, int frame, int x, int y) |
Draw unit's shadow. | |
static void | GetOrderPosition (const CUnit &unit, const COrderPtr order, int *x, int *y) |
static void | ShowSingleOrder (const CUnit &unit, int x1, int y1, const COrderPtr order) |
void | ShowOrder (const CUnit &unit) |
Show a unit's orders. | |
static void | DrawInformations (const CUnit &unit, const CUnitType *type, int x, int y) |
static void | DrawConstructionShadow (const CUnitType &type, const CConstructionFrame *cframe, int frame, int x, int y) |
static void | DrawConstruction (const int player, const CConstructionFrame *cframe, const CUnitType &type, int frame, int x, int y) |
static bool | DrawLevelCompare (const CUnit *c1, const CUnit *c2) |
int | FindAndSortUnits (const CViewport *vp, CUnit *table[]) |
Draw all units visible on map in viewport. | |
int | FindAndSortUnits (const CViewport *vp, CUnitDrawProxy table[]) |
Defines | |
#define | CORNER_PIXELS 6 |
#define CORNER_PIXELS 6 |
static int CclDefineSprites | ( | lua_State * | l | ) | [static] |
Define the sprite to show variables.
l | Lua_state |
void CleanDecorations | ( | ) |
Clean the decorations (health,mana) of units.
Clean decorations.
void DecorationCclRegister | ( | ) |
Register CCL decorations features.
Register CCL features for decorations.
static void DrawConstruction | ( | const int | player, | |
const CConstructionFrame * | cframe, | |||
const CUnitType & | type, | |||
int | frame, | |||
int | x, | |||
int | y | |||
) | [static] |
Draw construction.
unit | Unit pointer. | |
cframe | Construction frame to draw. | |
type | Unit type. | |
frame | Frame number. | |
x | X position. | |
y | Y position. |
static void DrawConstructionShadow | ( | const CUnitType & | type, | |
const CConstructionFrame * | cframe, | |||
int | frame, | |||
int | x, | |||
int | y | |||
) | [static] |
Draw construction shadow.
unit | Unit pointer. | |
cframe | Construction frame | |
frame | Frame number to draw. | |
x | X position. | |
y | Y position. |
Draw decoration (invis, for the unit.)
unit | Pointer to the unit. | |
type | Type of the unit. | |
x | Screen X position of the unit. | |
y | Screen Y position of the unit. |
Draw additional informations of a unit.
unit | Unit pointer of drawn unit. | |
type | Unit-type pointer. | |
x | X screen pixel position of unit. | |
y | Y screen pixel position of unit. |
Compare what order 2 units should be drawn on the map
c1 | First Unit to compare (*Unit) | |
c2 | Second Unit to compare (*Unit) |
void DrawSelectionCircle | ( | Uint32 | color, | |
int | x1, | |||
int | y1, | |||
int | x2, | |||
int | y2 | |||
) |
Draw circle around unit.
Show selected units with circle.
color | Color to draw circle | |
x1,y1 | Coordinates of the top left corner. | |
x2,y2 | Coordinates of the bottom right corner. |
void DrawSelectionCircleWithTrans | ( | Uint32 | color, | |
int | x1, | |||
int | y1, | |||
int | x2, | |||
int | y2 | |||
) |
Draw circle filled with alpha around unit.
Show selected units with circle.
color | Color to draw and fill circle. | |
x1,y1 | Coordinates of the top left corner. | |
x2,y2 | Coordinates of the bottom right corner. |
void DrawSelectionCorners | ( | Uint32 | color, | |
int | x1, | |||
int | y1, | |||
int | x2, | |||
int | y2 | |||
) |
Draw corners around unit.
Draw selected corners around the unit.
color | Color to draw corners. | |
x1,y1 | Coordinates of the top left corner. | |
x2,y2 | Coordinates of the bottom right corner. |
void DrawSelectionNone | ( | Uint32 | , | |
int | , | |||
int | , | |||
int | , | |||
int | ||||
) |
Draw nothing around unit.
Don't show selected units.
color | Color to draw, nothing in this case. | |
x1,y1 | Coordinates of the top left corner. | |
x2,y2 | Coordinates of the bottom right corner. |
void DrawSelectionRectangle | ( | Uint32 | color, | |
int | x1, | |||
int | y1, | |||
int | x2, | |||
int | y2 | |||
) |
Draw rectangle around unit.
Draw selected rectangle around the unit.
color | Color to draw rectangle. | |
x1,y1 | Coordinates of the top left corner. | |
x2,y2 | Coordinates of the bottom right corner. |
void DrawSelectionRectangleWithTrans | ( | Uint32 | color, | |
int | x1, | |||
int | y1, | |||
int | x2, | |||
int | y2 | |||
) |
Draw rectangle filled with alpha around unit.
Draw selected rectangle around the unit.
color | Color to draw and fill rectangle. | |
x1,y1 | Coordinates of the top left corner. | |
x2,y2 | Coordinates of the bottom right corner. |
void DrawShadow | ( | const CUnitType & | type, | |
int | frame, | |||
int | x, | |||
int | y | |||
) |
Draw unit's shadow.
Draw unit's shadow.
type | Pointer to the unit type. | |
frame | Frame number | |
x | Screen X position of the unit. | |
y | Screen Y position of the unit. |
FIXME: quick hack for split screen.
CurrentViewport.
Show selection marker around a unit.
unit | Pointer to unit. |
int FindAndSortUnits | ( | const CViewport * | vp, | |
CUnitDrawProxy | table[] | |||
) |
Draw all units visible on map in viewport.
Find all units to draw in viewport.
vp | Viewport to be drawn. | |
table | Table of units to return in sorted order |
static void GetOrderPosition | ( | const CUnit & | unit, | |
const COrderPtr | order, | |||
int * | x, | |||
int * | y | |||
) | [static] |
Get the location of a unit's order.
unit | Pointer to unit. | |
order | Pointer to order. | |
x | Resulting screen X cordinate. | |
y | Resulting screen Y cordinate. |
int GetSpriteIndex | ( | const char * | SpriteName | ) |
Return the index of the sprite named SpriteName.
SpriteName | Name of the sprite. |
void LoadDecorations | ( | ) |
Load the decorations (health,mana) of units.
Load decoration.
static int s_max | ( | int | a, | |
int | b | |||
) | [inline, static] |
static int s_min | ( | int | a, | |
int | b | |||
) | [inline, static] |
void ShowOrder | ( | const CUnit & | unit | ) |
Show a unit's orders.
Show the current order of a unit.
unit | Pointer to the unit. |
Show the order on map.
unit | Unit pointer. | |
x1 | X pixel coordinate. | |
y1 | Y pixel coordinate. | |
order | Order to display. |
void UpdateUnitVariables | ( | const CUnit & | unit | ) |
Update custom Variables with other variable (like Hp, ...).
Update unit variables which are not user defined.
const CViewport* CurrentViewport |
Config: reveal attacker enabled.
DecoSpriteType DecoSprite [static] |
void(* DrawSelection)(Uint32 color, int x1, int y1, int x2, int y2) = DrawSelectionNone |
Show orders for some time.
Show that units are selected.
color | FIXME | |
x1,y1 | Coordinates of the top left corner. | |
x2,y2 | Coordinates of the bottom right corner. |
unsigned long ShowOrdersCount |
All sprite's infos.
Number of units used.