diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/common.h | 13 | ||||
-rw-r--r-- | include/entities.h | 4 | ||||
-rw-r--r-- | include/world.h | 9 |
3 files changed, 21 insertions, 5 deletions
diff --git a/include/common.h b/include/common.h index 08ec73f..207b95f 100644 --- a/include/common.h +++ b/include/common.h @@ -14,6 +14,7 @@ #include <math.h> #include <string> #include <fstream> +#include <thread> #define GLEW_STATIC #include <GL/glew.h> @@ -34,7 +35,7 @@ typedef unsigned int uint; * This flag lets the compiler know that we want to use shaders. */ -#define SHADERSs +#define SHADERS /** * This structure contains a set of coordinates for ease of coding. @@ -45,6 +46,12 @@ typedef struct { float y; } vec2; +typedef struct { + float x; + float y; + float z; +} vec3; + /** * This structure contains two sets of coordinates for ray drawing. */ @@ -70,7 +77,7 @@ typedef struct{ * The desired width of the game window. */ -#define SCREEN_WIDTH 1024 +#define SCREEN_WIDTH 1280 /** * The desired height of the game window. @@ -141,6 +148,8 @@ extern vec2 offset; */ extern unsigned int loops; +extern GLuint shaderProgram; + /** * Prints a formatted debug message to the console, along with the callee's file and line * number. diff --git a/include/entities.h b/include/entities.h index 6d192fe..a4bc282 100644 --- a/include/entities.h +++ b/include/entities.h @@ -126,6 +126,7 @@ public: GENDER gender; Texturec *tex; + Texturec *ntex; unsigned int randDialog; @@ -140,7 +141,7 @@ public: virtual ~Entity(){} }; -class Player : public Entity { +class Player : public Entity{ public: QuestHandler qh; bool light = false; @@ -149,7 +150,6 @@ public: ~Player(); void interact(); }; - class NPC : public Entity{ public: std::vector<int (*)(NPC *)>aiFunc; diff --git a/include/world.h b/include/world.h index 4b3a891..e10d0dc 100644 --- a/include/world.h +++ b/include/world.h @@ -26,7 +26,7 @@ * Defines how many game ticks it takes for a day to elapse. */ -#define DAY_CYCLE 3000 +#define DAY_CYCLE 12000 /** * The background type enum. @@ -51,6 +51,11 @@ typedef enum { RAIN /**< Rain (not implemented :) )*/ } WEATHER; + +typedef struct{ + vec2 loc; + Color color; +}Light; /** * The line structure. * This structure is used to store the world's ground, stored in vertical @@ -165,6 +170,7 @@ public: std::vector<Entity *> entity; std::vector<Object *> object; std::vector<Particles *> particles; + std::vector<Light > light; void addStructure(_TYPE t,BUILD_SUB sub,float x,float y,World *inside); void addVillage(int bCount, int npcMin, int npcMax,_TYPE t,float x,float y,World *outside); @@ -173,6 +179,7 @@ public: void addNPC(float x,float y); void addObject(ITEM_ID, bool, const char *, float, float); void addParticle(float, float, float, float, float, float, Color color, int); + void addLight(vec2, Color); void update(Player *p,unsigned int delta); |