author | Tero Marttila <terom@fixme.fi> |
Tue, 27 Jan 2009 00:25:58 +0200 | |
changeset 439 | 9823e6cd1086 |
parent 418 | 194bc810a570 |
permissions | -rw-r--r-- |
296
4d3ebaa29430
add separate Types.hh, and fix projectile-worm collisions on network
terom
parents:
diff
changeset
|
1 |
#ifndef TYPES_HH |
4d3ebaa29430
add separate Types.hh, and fix projectile-worm collisions on network
terom
parents:
diff
changeset
|
2 |
#define TYPES_HH |
4d3ebaa29430
add separate Types.hh, and fix projectile-worm collisions on network
terom
parents:
diff
changeset
|
3 |
|
4d3ebaa29430
add separate Types.hh, and fix projectile-worm collisions on network
terom
parents:
diff
changeset
|
4 |
/** |
4d3ebaa29430
add separate Types.hh, and fix projectile-worm collisions on network
terom
parents:
diff
changeset
|
5 |
* Define various types |
4d3ebaa29430
add separate Types.hh, and fix projectile-worm collisions on network
terom
parents:
diff
changeset
|
6 |
*/ |
4d3ebaa29430
add separate Types.hh, and fix projectile-worm collisions on network
terom
parents:
diff
changeset
|
7 |
|
300 | 8 |
#include "Vector.hh" |
9 |
||
296
4d3ebaa29430
add separate Types.hh, and fix projectile-worm collisions on network
terom
parents:
diff
changeset
|
10 |
#include <stdint.h> |
4d3ebaa29430
add separate Types.hh, and fix projectile-worm collisions on network
terom
parents:
diff
changeset
|
11 |
|
300 | 12 |
/* |
13 |
* Standard vector used for Physics stuff |
|
14 |
*/ |
|
370
39e59dd36b6e
clean up Vector a bit, remove unused Terrain -> direction function
terom
parents:
311
diff
changeset
|
15 |
typedef VectorType<float> Vector; |
300 | 16 |
|
296
4d3ebaa29430
add separate Types.hh, and fix projectile-worm collisions on network
terom
parents:
diff
changeset
|
17 |
/** |
418
194bc810a570
add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents:
417
diff
changeset
|
18 |
* Message severity, WARN and above should go to stderr, INFO and DEBUG to stdout |
194bc810a570
add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents:
417
diff
changeset
|
19 |
* |
194bc810a570
add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents:
417
diff
changeset
|
20 |
* @see Engine::log |
194bc810a570
add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents:
417
diff
changeset
|
21 |
* @see EngineConfig::log_level |
194bc810a570
add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents:
417
diff
changeset
|
22 |
* @see Logger |
194bc810a570
add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents:
417
diff
changeset
|
23 |
*/ |
194bc810a570
add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents:
417
diff
changeset
|
24 |
enum LogLevel { |
194bc810a570
add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents:
417
diff
changeset
|
25 |
FATAL, |
194bc810a570
add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents:
417
diff
changeset
|
26 |
ERROR, |
194bc810a570
add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents:
417
diff
changeset
|
27 |
WARN, |
194bc810a570
add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents:
417
diff
changeset
|
28 |
INFO, |
194bc810a570
add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents:
417
diff
changeset
|
29 |
DEBUG, |
194bc810a570
add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents:
417
diff
changeset
|
30 |
}; |
194bc810a570
add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents:
417
diff
changeset
|
31 |
|
194bc810a570
add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents:
417
diff
changeset
|
32 |
/** |
296
4d3ebaa29430
add separate Types.hh, and fix projectile-worm collisions on network
terom
parents:
diff
changeset
|
33 |
* A player's health is measured in... |
4d3ebaa29430
add separate Types.hh, and fix projectile-worm collisions on network
terom
parents:
diff
changeset
|
34 |
*/ |
4d3ebaa29430
add separate Types.hh, and fix projectile-worm collisions on network
terom
parents:
diff
changeset
|
35 |
typedef int16_t Health; |
4d3ebaa29430
add separate Types.hh, and fix projectile-worm collisions on network
terom
parents:
diff
changeset
|
36 |
|
4d3ebaa29430
add separate Types.hh, and fix projectile-worm collisions on network
terom
parents:
diff
changeset
|
37 |
/** |
4d3ebaa29430
add separate Types.hh, and fix projectile-worm collisions on network
terom
parents:
diff
changeset
|
38 |
* Terrain/Graphics pixel dimension values are long ints |
4d3ebaa29430
add separate Types.hh, and fix projectile-worm collisions on network
terom
parents:
diff
changeset
|
39 |
*/ |
4d3ebaa29430
add separate Types.hh, and fix projectile-worm collisions on network
terom
parents:
diff
changeset
|
40 |
typedef long int PixelDimension; |
4d3ebaa29430
add separate Types.hh, and fix projectile-worm collisions on network
terom
parents:
diff
changeset
|
41 |
|
4d3ebaa29430
add separate Types.hh, and fix projectile-worm collisions on network
terom
parents:
diff
changeset
|
42 |
/** |
4d3ebaa29430
add separate Types.hh, and fix projectile-worm collisions on network
terom
parents:
diff
changeset
|
43 |
* A Terrain/Pixel coordinate as a PixelDimension Vector |
4d3ebaa29430
add separate Types.hh, and fix projectile-worm collisions on network
terom
parents:
diff
changeset
|
44 |
*/ |
370
39e59dd36b6e
clean up Vector a bit, remove unused Terrain -> direction function
terom
parents:
311
diff
changeset
|
45 |
typedef VectorType<PixelDimension> PixelCoordinate; |
296
4d3ebaa29430
add separate Types.hh, and fix projectile-worm collisions on network
terom
parents:
diff
changeset
|
46 |
|
300 | 47 |
/** |
410
41fd46cffc52
start working out the Graphics/* code, this is a long way from compiling, let alone working
Tero Marttila <terom@fixme.fi>
parents:
393
diff
changeset
|
48 |
* Dimensions of something in pixels |
41fd46cffc52
start working out the Graphics/* code, this is a long way from compiling, let alone working
Tero Marttila <terom@fixme.fi>
parents:
393
diff
changeset
|
49 |
*/ |
41fd46cffc52
start working out the Graphics/* code, this is a long way from compiling, let alone working
Tero Marttila <terom@fixme.fi>
parents:
393
diff
changeset
|
50 |
struct PixelDimensions { |
41fd46cffc52
start working out the Graphics/* code, this is a long way from compiling, let alone working
Tero Marttila <terom@fixme.fi>
parents:
393
diff
changeset
|
51 |
/** Item width/height */ |
41fd46cffc52
start working out the Graphics/* code, this is a long way from compiling, let alone working
Tero Marttila <terom@fixme.fi>
parents:
393
diff
changeset
|
52 |
PixelDimension width, height; |
41fd46cffc52
start working out the Graphics/* code, this is a long way from compiling, let alone working
Tero Marttila <terom@fixme.fi>
parents:
393
diff
changeset
|
53 |
|
41fd46cffc52
start working out the Graphics/* code, this is a long way from compiling, let alone working
Tero Marttila <terom@fixme.fi>
parents:
393
diff
changeset
|
54 |
/** Simple constructor */ |
41fd46cffc52
start working out the Graphics/* code, this is a long way from compiling, let alone working
Tero Marttila <terom@fixme.fi>
parents:
393
diff
changeset
|
55 |
PixelDimensions (PixelDimension width, PixelDimension height) : |
41fd46cffc52
start working out the Graphics/* code, this is a long way from compiling, let alone working
Tero Marttila <terom@fixme.fi>
parents:
393
diff
changeset
|
56 |
width(width), height(height) |
411
106aaf6eadfe
there's a grain of truth in the new graphics code now...
Tero Marttila <terom@fixme.fi>
parents:
410
diff
changeset
|
57 |
{ } |
410
41fd46cffc52
start working out the Graphics/* code, this is a long way from compiling, let alone working
Tero Marttila <terom@fixme.fi>
parents:
393
diff
changeset
|
58 |
}; |
41fd46cffc52
start working out the Graphics/* code, this is a long way from compiling, let alone working
Tero Marttila <terom@fixme.fi>
parents:
393
diff
changeset
|
59 |
|
41fd46cffc52
start working out the Graphics/* code, this is a long way from compiling, let alone working
Tero Marttila <terom@fixme.fi>
parents:
393
diff
changeset
|
60 |
/** |
393
5dd4d782cf3a
a basic implementation of game messages, plus some weird GameStateEvent stuff
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
61 |
* A rectangular area of pixels |
5dd4d782cf3a
a basic implementation of game messages, plus some weird GameStateEvent stuff
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
62 |
*/ |
5dd4d782cf3a
a basic implementation of game messages, plus some weird GameStateEvent stuff
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
63 |
struct PixelArea { |
5dd4d782cf3a
a basic implementation of game messages, plus some weird GameStateEvent stuff
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
64 |
PixelDimension left, top, right, bottom; |
5dd4d782cf3a
a basic implementation of game messages, plus some weird GameStateEvent stuff
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
65 |
|
5dd4d782cf3a
a basic implementation of game messages, plus some weird GameStateEvent stuff
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
66 |
PixelArea (PixelDimension left, PixelDimension top, PixelDimension right, PixelDimension bottom) : |
5dd4d782cf3a
a basic implementation of game messages, plus some weird GameStateEvent stuff
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
67 |
left(left), top(top), right(right), bottom(bottom) |
5dd4d782cf3a
a basic implementation of game messages, plus some weird GameStateEvent stuff
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
68 |
{ } |
5dd4d782cf3a
a basic implementation of game messages, plus some weird GameStateEvent stuff
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
69 |
}; |
5dd4d782cf3a
a basic implementation of game messages, plus some weird GameStateEvent stuff
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
70 |
|
5dd4d782cf3a
a basic implementation of game messages, plus some weird GameStateEvent stuff
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
71 |
/** |
300 | 72 |
* A time interval, measured in real milliseconds |
73 |
*/ |
|
311
440763821484
make Input have its own timer, and add key-repeat handling, and fix some warnings
terom
parents:
300
diff
changeset
|
74 |
typedef signed long TimeMS; |
300 | 75 |
|
76 |
/** |
|
77 |
* Abstract tick count, defined as a number of Timer::interval's against real time |
|
78 |
*/ |
|
311
440763821484
make Input have its own timer, and add key-repeat handling, and fix some warnings
terom
parents:
300
diff
changeset
|
79 |
typedef int32_t TickCount; |
296
4d3ebaa29430
add separate Types.hh, and fix projectile-worm collisions on network
terom
parents:
diff
changeset
|
80 |
|
417
c503e0c6a740
support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents:
411
diff
changeset
|
81 |
/** |
c503e0c6a740
support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents:
411
diff
changeset
|
82 |
* Terrain "pixel" type |
c503e0c6a740
support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents:
411
diff
changeset
|
83 |
* |
c503e0c6a740
support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents:
411
diff
changeset
|
84 |
* @see TerrainType |
c503e0c6a740
support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents:
411
diff
changeset
|
85 |
*/ |
c503e0c6a740
support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents:
411
diff
changeset
|
86 |
typedef uint8_t TerrainPixel; |
c503e0c6a740
support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents:
411
diff
changeset
|
87 |
|
296
4d3ebaa29430
add separate Types.hh, and fix projectile-worm collisions on network
terom
parents:
diff
changeset
|
88 |
#endif |