blob: 13ccafcabd5c924357dc1bc2d075e9ef31305649 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#ifndef WORLD_H
#define WORLD_H
#include <common.h>
#define goWorldLeft(w) if(w->toLeft){w=w->toLeft;}
#define goWorldRight(w) if(w->toRight){w=w->toRight;}
#define LAYER_SCALE 2
class World {
private:
struct line_t {
// x = 2.0 (window width) / HLINES
double start; // Where to change to dirt, going down (y)
} __attribute__ ((packed)) *line;
unsigned int lineCount;
bool root,drawn;
public:
World *behind,*infront;
World *toLeft,*toRight;
World(void);
World(const float width,World *l,World *r);
void draw(void);
void detect(vec2 *v,const float width);
float getWidth(void);
void saveToFile(FILE *f,World *parent);
void loadFromFile(FILE *f,World *parent);
void addLayer(void);
void setRoot(void);
};
#endif // WORLD_H
|