fix redraw at top-left of map
[Tsunagari.git] / src / common.h
bloba88f6b8452727fd56d267cddf524528b071c884b
1 /******************************
2 ** Tsunagari Tile Engine **
3 ** common.h **
4 ** Copyright 2011 OmegaSDG **
5 ******************************/
7 #ifndef COMMON_H
8 #define COMMON_H
10 #include <string>
11 #include <vector>
13 #include "log.h"
15 //! Ternary Data Type
16 enum tern {
17 T_True = true,
18 T_False = false,
19 T_None
22 //! Coordinate Type
23 struct coord_t {
24 long x;
25 long y;
26 long z;
29 //! coord_t constructor
30 coord_t coord(long x, long y, long z);
32 //! 3D Cube Type
33 struct cube_t {
34 long x1, x2;
35 long y1, y2;
36 long z1, z2;
39 //! cube_t constructor
40 cube_t cube(long x1, long y1, long z1,
41 long x2, long y2, long z2);
43 //! Client Configuration
44 struct ClientValues {
45 std::string world;
46 std::string dtdDir;
47 coord_t windowsize;
48 bool fullscreen;
49 bool cache_enabled;
50 int cache_ttl;
51 int cache_size;
52 message_mode_t loglevel;
55 //! Returns a bool from a "true"/"false" string.
56 bool parseBool(const std::string& s);
58 //! Split a string by a delimiter.
59 std::vector<std::string> splitStr(std::string str,
60 const std::string& delimiter);
62 //! Convert an integer to a representative string.
63 std::string itostr(long in);
65 #endif