_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ T H E W A R B E G I N S Stratagus - A free fantasy real time strategy game engine
#include <vector>
#include "stratagus.h"
#include "actions.h"
#include "action/action_build.h"
#include "action/action_built.h"
#include "action/action_upgradeto.h"
#include "construct.h"
#include "cursor.h"
#include "editor.h"
#include "font.h"
#include "interface.h"
#include "map.h"
#include "player.h"
#include "script.h"
#include "settings.h"
#include "sound.h"
#include "translate.h"
#include "unit.h"
#include "unit_find.h"
#include "unitsound.h"
#include "unittype.h"
#include "ui.h"
#include "video.h"
Classes | |
class | Decoration |
class | DecoSpriteType |
unit_draw.cpp - The draw routines for units. | |
static DecoSpriteType | DecoSprite |
unsigned long | ShowOrdersCount |
All sprite's infos. More... | |
unsigned long | ShowNameDelay |
Show orders for some time. More... | |
unsigned long | ShowNameTime |
Delay to show unit's name. More... | |
void(* | DrawSelection )(IntColor color, int x1, int y1, int x2, int y2) = DrawSelectionNone |
Show unit's name for some time. More... | |
const CViewport * | CurrentViewport |
Config: spend resources for building with multiple workers. More... | |
static float | DrawSelectionEllipseFactor = 0.0f |
void(*)(IntColor, int, int, int, int) | DrawSelectionEllipse (float factor) |
Draw ellipse around unit. More... | |
void | DrawUnitSelection (const CViewport &vp, const CUnit &unit) |
FIXME: quick hack for split screen. More... | |
void | DrawSelectionNone (IntColor, int, int, int, int) |
Draw nothing around unit. More... | |
void | DrawSelectionCircle (IntColor color, int x1, int y1, int x2, int y2) |
Draw circle around unit. More... | |
void | DrawSelectionCircleWithTrans (IntColor color, int x1, int y1, int x2, int y2) |
Draw circle filled with alpha around unit. More... | |
void | DrawSelectionRectangle (IntColor color, int x1, int y1, int x2, int y2) |
Draw rectangle around unit. More... | |
void | DrawSelectionRectangleWithTrans (IntColor color, int x1, int y1, int x2, int y2) |
Draw rectangle filled with alpha around unit. More... | |
void | DrawSelectionCorners (IntColor color, int x1, int y1, int x2, int y2) |
Draw corners around unit. More... | |
void | DrawSelectionEllipseFunc (IntColor color, int x1, int y1, int x2, int y2) |
int | GetSpriteIndex (const char *SpriteName) |
static int | CclDefineSprites (lua_State *l) |
void | DecorationCclRegister () |
Register CCL decorations features. More... | |
void | LoadDecorations () |
Load the decorations (health,mana) of units. More... | |
void | CleanDecorations () |
Clean the decorations (health,mana) of units. More... | |
static void | DrawDecoration (const CUnit &unit, const CUnitType &type, const PixelPos &screenPos) |
void | DrawShadow (const CUnitType &type, int frame, const PixelPos &screenPos) |
Draw unit's shadow. More... | |
void | ShowOrder (const CUnit &unit) |
Show a unit's orders. More... | |
static void | DrawInformations (const CUnit &unit, const CUnitType &type, const PixelPos &screenPos) |
static void | DrawConstructionShadow (const CUnitType &type, const CConstructionFrame *cframe, int frame, const PixelPos &screenPos) |
static void | DrawConstruction (const int player, const CConstructionFrame *cframe, const CUnitType &type, int frame, const PixelPos &screenPos) |
static bool | DrawLevelCompare (const CUnit *c1, const CUnit *c2) |
int | FindAndSortUnits (const CViewport &vp, std::vector< CUnit * > &table) |
Draw all units visible on map in viewport. More... | |
|
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 |
Draw construction.
unit | Unit pointer. |
cframe | Construction frame to draw. |
type | Unit type. |
frame | Frame number. |
screenPos | screen (top left) position of the unit. |
|
static |
Draw construction shadow.
unit | Unit pointer. |
cframe | Construction frame |
frame | Frame number to draw. |
screenPos | screen (top left) position of the unit. |
|
static |
Draw decoration (invis, for the unit.)
unit | Pointer to the unit. |
type | Type of the unit. |
screenPos | Screen position of the unit. |
|
static |
Draw additional informations of a unit.
unit | Unit pointer of drawn unit. |
type | Unit-type pointer. |
screenPos | screen pixel (top left) 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) |
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. |
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. |
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. |
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. |
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. |
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. |
Draw unit's shadow.
Draw unit's shadow.
type | Pointer to the unit type. |
frame | Frame number |
screenPos | Screen position of the unit. |
FIXME: quick hack for split screen.
CurrentViewport.
Show selection marker around a unit.
unit | Pointer to unit. |
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 |
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.
Show a unit's orders.
Show the current order of a unit.
unit | Pointer to the unit. |
const CViewport* CurrentViewport |
Config: spend resources for building with multiple workers.
|
static |
void(* DrawSelection) (IntColor color, int x1, int y1, int x2, int y2) = DrawSelectionNone |
Show unit's name 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. |
|
static |
Show selected units with ellipse. (Useful for fake-isometric views)
color | Color to draw circle |
x1,y1 | Coordinates of the top left corner. |
x2,y2 | Coordinates of the bottom right corner. |
factor | Stretch factor in horizontal direction |
unsigned long ShowNameDelay |
Show orders for some time.
unsigned long ShowNameTime |
Delay to show unit's name.
unsigned long ShowOrdersCount |
All sprite's infos.