From 6be7b11513cdedc17358da314c6e5a5630be00c1 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Fri, 20 Nov 2015 08:50:57 -0500 Subject: background draw re-do --- include/Texture.h | 13 ++++++------- include/world.h | 31 ++++++++++++++++++++++++++----- 2 files changed, 32 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/include/Texture.h b/include/Texture.h index fdb294d..81a743e 100644 --- a/include/Texture.h +++ b/include/Texture.h @@ -3,23 +3,22 @@ #include +#define DEBUG + namespace Texture{ GLuint loadTexture(const char *fileName); } class Texturec{ +private: + GLuint *image; + int texState; public: Texturec(uint amt, ...); void bindNext(); void bindPrev(); void bind(int); void walk(); - - GLuint *image; - int texState; -private: - - }; -#endif //TEXTURE_H \ No newline at end of file +#endif //TEXTURE_H diff --git a/include/world.h b/include/world.h index 8f4ea51..1a96252 100644 --- a/include/world.h +++ b/include/world.h @@ -9,6 +9,18 @@ // or not calculated at all, so GEN_INC is also used to decrease 'lineCount' in functions like draw() // and detect(). +#define DAY_CYCLE 3000 + +typedef enum { + BG_FOREST +} WORLD_BG_TYPE; + +typedef enum { + SUNNY = 0, + DARK, + RAIN +} WEATHER; + struct line_t { bool gs; float y,gh[2]; @@ -56,6 +68,14 @@ protected: unsigned int lineCount; + /* + * Contains the background image layers (including the background image). + */ + + vec2 *star; + + Texturec *bgTex; + public: /* @@ -78,16 +98,11 @@ public: std::vector entity; std::vector object; - //template - //void getEntityLocation(std::vector&, unsigned int); - void addStructure(_TYPE t,float x,float y,World *outside,World *inside); void addMob(int t,float x,float y); void addMob(int t,float x,float y,void (*hey)()); void addNPC(float x,float y); void addObject(int, float, float); - - //void removeObjet(Object); void update(Player *p,unsigned int delta); @@ -106,6 +121,12 @@ public: virtual void generate(unsigned int width); void generateFunc(unsigned int width,float(*func)(float)); + /* + * Adds images to using for the background. + */ + + void setBackground(WORLD_BG_TYPE bgt); + /* * Looks for the furthest back layer in this world and adds a new layer of width `width` behind it. */ -- cgit v1.2.3