aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2015-11-20 08:50:57 -0500
committerClyne Sullivan <tullivan99@gmail.com>2015-11-20 08:50:57 -0500
commit6be7b11513cdedc17358da314c6e5a5630be00c1 (patch)
tree67ecbdfb7f2f31c87707959404cced383fb3a0b6 /include
parent5598e4d1f52224f2d075dc318868e284b2f20a78 (diff)
background draw re-do
Diffstat (limited to 'include')
-rw-r--r--include/Texture.h13
-rw-r--r--include/world.h31
2 files changed, 32 insertions, 12 deletions
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 <common.h>
+#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 *> entity;
std::vector<Object *> object;
- //template<class T>
- //void getEntityLocation(std::vector<T*>&, 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);
@@ -107,6 +122,12 @@ public:
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.
*/