client/picture.cc File Reference

#include <map>
#include <vector>
#include <dirent.h>
#include "picture.h"
#include "moros.h"
#include "../general/util.h"
#include "../general/log.h"

Classes

class  edge
class  tile
class  terrain
class  addition
class  wall
class  unit
class  tpos

Defines

#define DEBUG_ROUTINE   "picture"
#define MAX_CACHE   1000
#define side   36
#define hside   18

Functions

int epos (int n)
void add_directory (std::string dir)
int variant (pos p, int max)
pos image (pos size)
void add_terrains ()
std::string get_terrain (int terr, int type, bool snow, int from, int to)
void add_additions ()
void add_walls ()
void add_units ()
void add_images ()
void set_terrain (int type, int x, int y)
void set_add (int type, int x, int y, int dir)
void set_castle (int type, int x, int y)
void move_map (int dx, int dy)
int set_unit (int type, int action, int x, int y, int d, int u)
void paint ()
tpos calc_tpos (pos p)
pos calc_pos (tpos p)

Variables

char * edges [] = {"ne","n","nw","sw","s","se"}
char * castles [] = {"e","ne","nw","w", "sw","se"}
int dirnr = 0
std::vector
< std::string > 
dirs
std::map
< std::string, int > 
files
std::vector< terrainterrains
char * terrain_names []
std::vector< additionadditions
char * adds_names []
std::vector< wallwalls
char * wall_names []
std::vector< unitunits
char * unit_names []

Define Documentation

#define DEBUG_ROUTINE   "picture"

#define hside   18

#define MAX_CACHE   1000

#define side   36


Function Documentation

void add_additions (  ) 

void add_directory ( std::string  dir  ) 

void add_images (  ) 

void add_terrains (  ) 

void add_units (  ) 

void add_walls (  ) 

pos calc_pos ( tpos  p  ) 

tpos calc_tpos ( pos  p  ) 

int epos ( int  n  ) 

std::string get_terrain ( int  terr,
int  type,
bool  snow,
int  from,
int  to 
)

pos image ( pos  size  ) 

void move_map ( int  dx,
int  dy 
)

void paint (  ) 

Draw a map including units on it, keep the background for future usage

void set_add ( int  type,
int  x,
int  y,
int  dir 
)

void set_castle ( int  type,
int  x,
int  y 
)

void set_terrain ( int  type,
int  x,
int  y 
)

set a terrain type

int set_unit ( int  type,
int  action,
int  x,
int  y,
int  d,
int  u 
)

select a picture of a unit

Returns:
-1 = unit not found -2 = action not found 0 = ok
Parameters:
type  Type of unit
action  Action of the unit
x  Position in x
y  Position in y
d  Direction
u  Percentage underway into direction

int variant ( pos  p,
int  max 
)


Variable Documentation

std::vector<addition> additions

char* adds_names[]

Initial value:

{
    "pine", "great-tree", "willow", "farm-veg-spring", "tropical", "mountain_peak",
    "mine-abandoned", "rock", "river", "road", "road-bridge", "reed", "tent", "flag", "mushrooms",
    "windmill", "well", "village", "elven", "dwarven", "desert-village", "cave-village",
    "tropical-village", "swamp-village", "signpost", "scarecrow", "temple"
}

char* castles[] = {"e","ne","nw","w", "sw","se"}

int dirnr = 0

std::vector<std::string> dirs

char* edges[] = {"ne","n","nw","sw","s","se"}

std::map<std::string, int> files

char* terrain_names[]

Initial value:

{
    "ocean", "coast", "ford", "lava", "ice", "cave", "grass", "savanna", "dirt", "swamp", "desert",
    "desert-hills", "hills", "desert-mountains", "mountains", "wall"
}

std::vector<terrain> terrains

char* unit_names[]

Initial value:

{
    "peasant", "woodsman", "townsman", "ruffian", "bandit", "white-cleric", "white-mage", "mage",
    "arch-mage", "bowman", "halberdier", "heavy-infantry", "horseman", "ranger",
    "knight", "lancer", "longbowman", "paladin", "pikeman", "spearman", "swordsman",
    "galleon", "pirate", "transport", "wagon", "horse", "falcon", "friar", "hunter", "shepherd",
    "camel", "elephant"
}

std::vector<unit> units

char* wall_names[]

Initial value:

{
    "castle", "encampment", "dwarven-castle", "elven-castle", "ruin"
}

std::vector<wall> walls



Generated on Tue Jan 1 17:30:01 2008 for client/picture.cc File Reference by  doxygen   Visit the project page on SourceForge.net Logo