author | Tero Marttila <terom@fixme.fi> |
Sun, 02 Jun 2013 16:15:23 +0300 | |
changeset 448 | 34bdf0783874 |
parent 424 | f337a86d144e |
permissions | -rw-r--r-- |
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
1 |
#ifndef TERRAIN_HH |
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
2 |
#define TERRAIN_HH |
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
3 |
|
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
4 |
#include "Vector.hh" |
296
4d3ebaa29430
add separate Types.hh, and fix projectile-worm collisions on network
terom
parents:
255
diff
changeset
|
5 |
#include "Types.hh" |
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
6 |
#include "Config.hh" |
417
c503e0c6a740
support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents:
412
diff
changeset
|
7 |
#include "Configuration.hh" |
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
8 |
|
417
c503e0c6a740
support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents:
412
diff
changeset
|
9 |
#include <vector> |
c503e0c6a740
support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents:
412
diff
changeset
|
10 |
|
424
f337a86d144e
fix GRAPHICS_ENABLED configuration... probably broken again if the <ClanLib/Display> includes aren't there
Tero Marttila <terom@fixme.fi>
parents:
423
diff
changeset
|
11 |
#if GRAPHICS_ENABLED |
f337a86d144e
fix GRAPHICS_ENABLED configuration... probably broken again if the <ClanLib/Display> includes aren't there
Tero Marttila <terom@fixme.fi>
parents:
423
diff
changeset
|
12 |
#include "Graphics/Drawable.hh" |
f337a86d144e
fix GRAPHICS_ENABLED configuration... probably broken again if the <ClanLib/Display> includes aren't there
Tero Marttila <terom@fixme.fi>
parents:
423
diff
changeset
|
13 |
|
f337a86d144e
fix GRAPHICS_ENABLED configuration... probably broken again if the <ClanLib/Display> includes aren't there
Tero Marttila <terom@fixme.fi>
parents:
423
diff
changeset
|
14 |
#endif |
f337a86d144e
fix GRAPHICS_ENABLED configuration... probably broken again if the <ClanLib/Display> includes aren't there
Tero Marttila <terom@fixme.fi>
parents:
423
diff
changeset
|
15 |
|
406
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
16 |
/** |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
17 |
* Different types of terrain available |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
18 |
*/ |
255
99431fdb0dc8
add PixelDimension/PixelCoordinate types, convert Terrain to use them, and convert/clean up drawing code
terom
parents:
248
diff
changeset
|
19 |
enum TerrainType { |
406
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
20 |
/** Empty space, air */ |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
21 |
TERRAIN_EMPTY = 0x00, |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
22 |
|
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
23 |
/** Dirt, which can be destroyed/dug through */ |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
24 |
TERRAIN_DIRT = 0x01, |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
25 |
|
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
26 |
/** Indestructible rock */ |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
27 |
TERRAIN_ROCK = 0x02 |
255
99431fdb0dc8
add PixelDimension/PixelCoordinate types, convert Terrain to use them, and convert/clean up drawing code
terom
parents:
248
diff
changeset
|
28 |
}; |
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
29 |
|
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
30 |
/** |
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
31 |
* Terrain class. Represents game terrain and contains member |
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
32 |
* functions to manipulate terrain and get info about it. |
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
33 |
* |
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
34 |
* Terrain resolution is a constant that is defined in |
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
35 |
* configuration. Terrain has a scale (i.e. the width and height in |
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
36 |
* "real" units. Scaling is needed because physics simulation uses |
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
37 |
* "real" units. The idea is that this class is used with "real" units |
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
38 |
* and it uses pixelcoordinates internally. |
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
39 |
*/ |
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
40 |
class Terrain { |
406
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
41 |
protected: |
408
e6cfc44266af
reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents:
406
diff
changeset
|
42 |
/** The terrain data is stored as a linear array in row-major order, with width * height elements */ |
406
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
43 |
TerrainPixel *terrain_buf; |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
44 |
|
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
45 |
/** Terrain dimensions */ |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
46 |
PixelDimension width, height; |
417
c503e0c6a740
support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents:
412
diff
changeset
|
47 |
|
c503e0c6a740
support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents:
412
diff
changeset
|
48 |
#if GRAPHICS_ENABLED |
406
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
49 |
/** We pre-render the textured terrain data for display */ |
203
3ec7ab40755f
send initial terrain data to clients using a new NETCHAN_TERRAIN_ARRAY channel using raw BigNetworkPacket
terom
parents:
185
diff
changeset
|
50 |
CL_PixelBuffer pixbuf; |
424
f337a86d144e
fix GRAPHICS_ENABLED configuration... probably broken again if the <ClanLib/Display> includes aren't there
Tero Marttila <terom@fixme.fi>
parents:
423
diff
changeset
|
51 |
|
f337a86d144e
fix GRAPHICS_ENABLED configuration... probably broken again if the <ClanLib/Display> includes aren't there
Tero Marttila <terom@fixme.fi>
parents:
423
diff
changeset
|
52 |
/** Generated texture pattern */ |
f337a86d144e
fix GRAPHICS_ENABLED configuration... probably broken again if the <ClanLib/Display> includes aren't there
Tero Marttila <terom@fixme.fi>
parents:
423
diff
changeset
|
53 |
std::vector<std::vector<int> > texture; |
417
c503e0c6a740
support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents:
412
diff
changeset
|
54 |
#endif |
c503e0c6a740
support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents:
412
diff
changeset
|
55 |
|
408
e6cfc44266af
reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents:
406
diff
changeset
|
56 |
public: |
255
99431fdb0dc8
add PixelDimension/PixelCoordinate types, convert Terrain to use them, and convert/clean up drawing code
terom
parents:
248
diff
changeset
|
57 |
/** |
409
1a03ff151abc
add --terrain-seed and --terrain-size arguments, plus bugfixes
Tero Marttila <terom@fixme.fi>
parents:
408
diff
changeset
|
58 |
* Construct a new terrain based on the given configuration |
1a03ff151abc
add --terrain-seed and --terrain-size arguments, plus bugfixes
Tero Marttila <terom@fixme.fi>
parents:
408
diff
changeset
|
59 |
* |
1a03ff151abc
add --terrain-seed and --terrain-size arguments, plus bugfixes
Tero Marttila <terom@fixme.fi>
parents:
408
diff
changeset
|
60 |
* @param config a TerrainConfig describing how to build the terrain |
255
99431fdb0dc8
add PixelDimension/PixelCoordinate types, convert Terrain to use them, and convert/clean up drawing code
terom
parents:
248
diff
changeset
|
61 |
*/ |
409
1a03ff151abc
add --terrain-seed and --terrain-size arguments, plus bugfixes
Tero Marttila <terom@fixme.fi>
parents:
408
diff
changeset
|
62 |
explicit Terrain (const TerrainConfig &config); |
255
99431fdb0dc8
add PixelDimension/PixelCoordinate types, convert Terrain to use them, and convert/clean up drawing code
terom
parents:
248
diff
changeset
|
63 |
|
99431fdb0dc8
add PixelDimension/PixelCoordinate types, convert Terrain to use them, and convert/clean up drawing code
terom
parents:
248
diff
changeset
|
64 |
/** |
408
e6cfc44266af
reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents:
406
diff
changeset
|
65 |
* Construct the terrain using the provided terrain data. The given \a terrain_buf must be a linear array in the |
e6cfc44266af
reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents:
406
diff
changeset
|
66 |
* same format as Terrain::terrain_buf, meaning a row-major order array with width * height elements. The buffer |
e6cfc44266af
reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents:
406
diff
changeset
|
67 |
* must be allocated on the heap using 'new []', and ownership will be transferred (i.e. the buffer is not copied, |
e6cfc44266af
reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents:
406
diff
changeset
|
68 |
* and will eventually be deleteĀ []'d). |
e6cfc44266af
reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents:
406
diff
changeset
|
69 |
* |
e6cfc44266af
reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents:
406
diff
changeset
|
70 |
* @param width terrain width |
e6cfc44266af
reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents:
406
diff
changeset
|
71 |
* @param height terrain height |
e6cfc44266af
reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents:
406
diff
changeset
|
72 |
* @param terrain_buf dynamically allocated width * height array of terrain data |
e6cfc44266af
reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents:
406
diff
changeset
|
73 |
*/ |
e6cfc44266af
reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents:
406
diff
changeset
|
74 |
Terrain (PixelDimension width, PixelDimension height, TerrainPixel *terrain_buf); |
e6cfc44266af
reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents:
406
diff
changeset
|
75 |
|
e6cfc44266af
reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents:
406
diff
changeset
|
76 |
/** |
e6cfc44266af
reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents:
406
diff
changeset
|
77 |
* Destructor, frees our terrain buffer |
255
99431fdb0dc8
add PixelDimension/PixelCoordinate types, convert Terrain to use them, and convert/clean up drawing code
terom
parents:
248
diff
changeset
|
78 |
*/ |
406
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
79 |
~Terrain (void); |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
80 |
|
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
81 |
private: |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
82 |
/* No copying */ |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
83 |
Terrain (const Terrain ©); |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
84 |
Terrain &operator= (const Terrain ©); |
255
99431fdb0dc8
add PixelDimension/PixelCoordinate types, convert Terrain to use them, and convert/clean up drawing code
terom
parents:
248
diff
changeset
|
85 |
|
99431fdb0dc8
add PixelDimension/PixelCoordinate types, convert Terrain to use them, and convert/clean up drawing code
terom
parents:
248
diff
changeset
|
86 |
protected: |
406
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
87 |
/** |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
88 |
* Set induvidual pixel value, updates both terrain_buf and pixbuf |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
89 |
*/ |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
90 |
inline void setType (PixelDimension x, PixelDimension y, TerrainType t) { |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
91 |
terrain_buf[y * width + x] = (TerrainPixel) t; |
255
99431fdb0dc8
add PixelDimension/PixelCoordinate types, convert Terrain to use them, and convert/clean up drawing code
terom
parents:
248
diff
changeset
|
92 |
|
417
c503e0c6a740
support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents:
412
diff
changeset
|
93 |
#if GRAPHICS_ENABLED |
406
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
94 |
// XXX: locking? |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
95 |
pixbuf.draw_pixel(x, y, getTexturePixel(x, y)); |
417
c503e0c6a740
support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents:
412
diff
changeset
|
96 |
#endif |
406
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
97 |
} |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
98 |
|
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
99 |
/** |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
100 |
* Generate random terrain using given seed |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
101 |
* |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
102 |
* @param seed seed for the random number generator |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
103 |
*/ |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
104 |
void generateTerrain (int seed); |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
105 |
|
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
106 |
/** |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
107 |
* Regenerates our pixbuf from the current terrain. This is a slow process, but using the pixbuffer directly |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
108 |
* greatly speeds up drawing. |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
109 |
*/ |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
110 |
void generatePixelBuffer (void); |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
111 |
|
424
f337a86d144e
fix GRAPHICS_ENABLED configuration... probably broken again if the <ClanLib/Display> includes aren't there
Tero Marttila <terom@fixme.fi>
parents:
423
diff
changeset
|
112 |
#if GRAPHICS_ENABLED |
406
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
113 |
/** |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
114 |
* Generates an area of random texture using a fractal-based algorithm, this can then be applied to the terrain |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
115 |
* pixels using noisifyPixel |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
116 |
*/ |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
117 |
void generateTexture(); |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
118 |
|
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
119 |
/** |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
120 |
* Applies noise generated using generateTexture to generate a slightly varying color for the terrain pixel |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
121 |
* at \a pc. |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
122 |
*/ |
423
947ab54de4b7
fix worst compilation errors when using the debian lenny gcc/libc...
Tero Marttila <terom@fixme.fi>
parents:
417
diff
changeset
|
123 |
Color getTexturePixel (PixelDimension x, PixelDimension y); |
424
f337a86d144e
fix GRAPHICS_ENABLED configuration... probably broken again if the <ClanLib/Display> includes aren't there
Tero Marttila <terom@fixme.fi>
parents:
423
diff
changeset
|
124 |
#endif |
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
125 |
|
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
126 |
/** |
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
127 |
* Scale parameter to "pixels" |
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
128 |
* |
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
129 |
* @param x Scaled value |
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
130 |
* @return Corresponding value in pixels |
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
131 |
*/ |
406
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
132 |
inline PixelDimension scale (float x) const { |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
133 |
return (int) x; |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
134 |
} |
243 | 135 |
|
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
136 |
public: |
255
99431fdb0dc8
add PixelDimension/PixelCoordinate types, convert Terrain to use them, and convert/clean up drawing code
terom
parents:
248
diff
changeset
|
137 |
/** |
99431fdb0dc8
add PixelDimension/PixelCoordinate types, convert Terrain to use them, and convert/clean up drawing code
terom
parents:
248
diff
changeset
|
138 |
* Get pixel location of a point that is in "real" units. |
99431fdb0dc8
add PixelDimension/PixelCoordinate types, convert Terrain to use them, and convert/clean up drawing code
terom
parents:
248
diff
changeset
|
139 |
* |
99431fdb0dc8
add PixelDimension/PixelCoordinate types, convert Terrain to use them, and convert/clean up drawing code
terom
parents:
248
diff
changeset
|
140 |
* @param point Point in "real" units |
99431fdb0dc8
add PixelDimension/PixelCoordinate types, convert Terrain to use them, and convert/clean up drawing code
terom
parents:
248
diff
changeset
|
141 |
* @return Int vector |
99431fdb0dc8
add PixelDimension/PixelCoordinate types, convert Terrain to use them, and convert/clean up drawing code
terom
parents:
248
diff
changeset
|
142 |
*/ |
406
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
143 |
inline PixelCoordinate getPixelCoordinate (Vector point) const { |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
144 |
return PixelCoordinate(scale(point.x), scale(point.y)); |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
145 |
} |
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
146 |
|
255
99431fdb0dc8
add PixelDimension/PixelCoordinate types, convert Terrain to use them, and convert/clean up drawing code
terom
parents:
248
diff
changeset
|
147 |
/** |
99431fdb0dc8
add PixelDimension/PixelCoordinate types, convert Terrain to use them, and convert/clean up drawing code
terom
parents:
248
diff
changeset
|
148 |
* Return the terrain dimensions Ć la a PixelCoordinate |
99431fdb0dc8
add PixelDimension/PixelCoordinate types, convert Terrain to use them, and convert/clean up drawing code
terom
parents:
248
diff
changeset
|
149 |
*/ |
408
e6cfc44266af
reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents:
406
diff
changeset
|
150 |
PixelCoordinate getDimensions (void) const { |
406
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
151 |
return PixelCoordinate(width, height); |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
152 |
} |
255
99431fdb0dc8
add PixelDimension/PixelCoordinate types, convert Terrain to use them, and convert/clean up drawing code
terom
parents:
248
diff
changeset
|
153 |
|
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
154 |
/** |
408
e6cfc44266af
reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents:
406
diff
changeset
|
155 |
* Return dimensions in component form |
e6cfc44266af
reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents:
406
diff
changeset
|
156 |
*/ |
e6cfc44266af
reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents:
406
diff
changeset
|
157 |
PixelDimension getWidth (void) const { |
e6cfc44266af
reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents:
406
diff
changeset
|
158 |
return width; |
e6cfc44266af
reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents:
406
diff
changeset
|
159 |
} |
e6cfc44266af
reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents:
406
diff
changeset
|
160 |
|
e6cfc44266af
reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents:
406
diff
changeset
|
161 |
PixelDimension getHeight (void) const { |
e6cfc44266af
reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents:
406
diff
changeset
|
162 |
return height; |
e6cfc44266af
reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents:
406
diff
changeset
|
163 |
} |
e6cfc44266af
reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents:
406
diff
changeset
|
164 |
|
e6cfc44266af
reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents:
406
diff
changeset
|
165 |
/** |
406
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
166 |
* Return the type of terrain at given position. Returns TERRAIN_ROCK if given point is not inside terrain area. |
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
167 |
* |
406
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
168 |
* @param x terrain x coordinate |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
169 |
* @param y terrain x coordinate |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
170 |
* @return terrain pixel type |
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
171 |
*/ |
406
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
172 |
TerrainType getType (PixelDimension x, PixelDimension y) const { |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
173 |
// XXX: optimize access by removing error checking? |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
174 |
if (x < 0 || y < 0 || x >= width || y >= height) |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
175 |
return TERRAIN_ROCK; |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
176 |
|
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
177 |
return (TerrainType) terrain_buf[y * width + x]; |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
178 |
} |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
179 |
|
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
180 |
inline TerrainType getType (PixelCoordinate pc) const { |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
181 |
return getType(pc.x, pc.y); |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
182 |
} |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
183 |
|
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
184 |
|
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
185 |
inline TerrainType getType (Vector point) const { |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
186 |
return getType(getPixelCoordinate(point)); |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
187 |
} |
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
188 |
|
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
189 |
/** |
406
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
190 |
* Get raw read-only terrain data buffer |
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
191 |
* |
406
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
192 |
* @see terrain_buf |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
193 |
*/ |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
194 |
const TerrainPixel* getTerrainBuffer (void) const; |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
195 |
|
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
196 |
/** |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
197 |
* Load new terrain data from given buffer. Must be the right size |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
198 |
* |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
199 |
* @see terrain_buf |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
200 |
*/ |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
201 |
void loadFromBuffer (const TerrainPixel *buf); |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
202 |
|
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
203 |
/** |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
204 |
* Check if the given point is terrain |
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
205 |
*/ |
255
99431fdb0dc8
add PixelDimension/PixelCoordinate types, convert Terrain to use them, and convert/clean up drawing code
terom
parents:
248
diff
changeset
|
206 |
bool collides (const Vector &point) const; |
406
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
207 |
|
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
208 |
/** |
406
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
209 |
* Check if the given line collides with terrain |
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
210 |
* |
406
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
211 |
* @param begin line starting point |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
212 |
* @param end line ending point |
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
213 |
*/ |
255
99431fdb0dc8
add PixelDimension/PixelCoordinate types, convert Terrain to use them, and convert/clean up drawing code
terom
parents:
248
diff
changeset
|
214 |
bool collides (const Vector &begin, const Vector &end) const; |
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
215 |
|
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
216 |
/** |
406
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
217 |
* Remove a circular area of terrain |
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
218 |
* |
406
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
219 |
* @param pos circle center |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
220 |
* @param r circle radius |
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
221 |
*/ |
255
99431fdb0dc8
add PixelDimension/PixelCoordinate types, convert Terrain to use them, and convert/clean up drawing code
terom
parents:
248
diff
changeset
|
222 |
void removeGround (const Vector &pos, float r); |
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
223 |
|
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
224 |
/** |
406
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
225 |
* Returns direction normal vector for the given \a point. |
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
226 |
* |
406
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
227 |
* \a point should be ground, and \a prevPoint air. |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
228 |
* |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
229 |
* @param point the ground that we collided into |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
230 |
* @param prevPoint position in air where we were before the collision |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
231 |
* @return direction ormal vector, or (0,0) if there's no terrain |
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
232 |
*/ |
255
99431fdb0dc8
add PixelDimension/PixelCoordinate types, convert Terrain to use them, and convert/clean up drawing code
terom
parents:
248
diff
changeset
|
233 |
Vector getNormal (Vector point, Vector prevPoint) const; |
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
234 |
|
417
c503e0c6a740
support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents:
412
diff
changeset
|
235 |
#if GRAPHICS_ENABLED |
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
236 |
/** |
406
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
237 |
* Draw the terrain onto the given graphics context |
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
238 |
* |
406
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
239 |
* @param gc Graphics to draw on |
a2e35ca66c74
cleanup Terrain, use a single linear array instead of nested vectors
Tero Marttila <terom@fixme.fi>
parents:
370
diff
changeset
|
240 |
* @param camera view position |
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
241 |
*/ |
412
721c60072091
new graphics code compiles... no, it doesn't work yet
Tero Marttila <terom@fixme.fi>
parents:
411
diff
changeset
|
242 |
virtual void draw (graphics::Display &display, PixelCoordinate camera = PixelCoordinate(0, 0)); |
417
c503e0c6a740
support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents:
412
diff
changeset
|
243 |
#endif |
185
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
244 |
}; |
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
245 |
|
25becd2cb026
that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff
changeset
|
246 |
#endif |