diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2016-01-16 12:31:42 -0500 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2016-01-16 12:31:42 -0500 |
commit | 4b21a0fa4e6a7e35b7d9a01bbc0a7080dd392996 (patch) | |
tree | 849e56e7515d9bcd3fdcd38840af07dc2ac77987 /include/world.h | |
parent | 48cf19db2fc33875e32209eb6e32728d019cd6da (diff) |
dynamic world linking
Diffstat (limited to 'include/world.h')
-rw-r--r-- | include/world.h | 57 |
1 files changed, 28 insertions, 29 deletions
diff --git a/include/world.h b/include/world.h index 91fcf8a..a1cc870 100644 --- a/include/world.h +++ b/include/world.h @@ -20,8 +20,16 @@ #define GEN_INC 10 +/** + * Defines the lowest possible y value for a world line. + */ #define GEN_MIN 80 + +/** + * Defines the highest possible y value for a randomly generated world line. + */ + #define GEN_MAX 110 @@ -54,11 +62,15 @@ typedef enum { RAIN /**< Rain (not implemented :) )*/ } WEATHER; +/** + * The light structure, used to store light coordinates and color. + */ + +typedef struct { + vec2 loc; /**< Light location */ + Color color; /**< Light color */ +} Light; -typedef struct{ - vec2 loc; - Color color; -}Light; /** * The line structure. * This structure is used to store the world's ground, stored in vertical @@ -156,13 +168,13 @@ public: * These pointers keep track of worlds that are adjacent to this one. Used in * ui.cpp for world jumping. */ - - World **toLeft, - **toRight, - *behind, - *infront; - /* + char *toLeft,*toRight; + + char *setToLeft(const char *file); + char *setToRight(const char *file); + + /** * These vectors contain the NPCs, Mobs, Structures and Objects that are * loaded inside the world, with the Entity vector containing pointers to * the contents of all the others. @@ -176,8 +188,8 @@ public: std::vector<Particles *> particles; std::vector<Light > light; - void addStructure(BUILD_SUB sub,float x,float y,World **inside);//,World **outside); - void addVillage(int bCount, int npcMin, int npcMax,World **inside); + void addStructure(BUILD_SUB sub,float x,float y,const char *inside); + void addVillage(int bCount, int npcMin, int npcMax,const char *inside); void addMob(int t,float x,float y); void addMob(int t,float x,float y,void (*hey)(Mob *)); void addNPC(float x,float y); @@ -222,19 +234,12 @@ public: void bgmPlay(World *prev); /* - * Looks for the furthest back layer in this world and adds a new layer of width `width` behind it. - */ - - void addLayer(unsigned int width); - - /* * Draw the world and entities based on the player's coordinates. Virtual for the same * reason generate() is. */ virtual void draw(Player *p); - /* * Detect the player and any entities in the current world. */ @@ -248,12 +253,7 @@ public: */ World *goWorldLeft(Player *p); - World *goWorldRight(Player *p); - World *goWorldBack(Player *p); - World *goWorldFront(Player *p); - - bool isWorldLeft(void); - bool isWorldRight(void); + World *goWorldRight(Player *p); /* * Called to enter/exit a structure. @@ -272,9 +272,6 @@ public: */ int getTheWidth(void); - - void save(std::ofstream *); - void load(std::ifstream *); }; /* @@ -289,7 +286,6 @@ float worldGetYBase(World *w); class IndoorWorld : public World { public: - World **outside; IndoorWorld(void); ~IndoorWorld(void); @@ -308,5 +304,8 @@ public: }; extern int worldShade; +extern char *currentXML; + +World *loadWorldFromXML(const char *path); #endif // WORLD_H |