aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/common.h8
-rw-r--r--include/entities.h9
-rw-r--r--include/world.h13
3 files changed, 24 insertions, 6 deletions
diff --git a/include/common.h b/include/common.h
index 9dcc110..207b95f 100644
--- a/include/common.h
+++ b/include/common.h
@@ -46,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.
*/
@@ -142,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 7a97200..a4bc282 100644
--- a/include/entities.h
+++ b/include/entities.h
@@ -44,6 +44,8 @@ enum BUILD_SUB{
FOUNTAIN
};
+class World;
+
class Particles{
public:
vec2 loc;
@@ -124,6 +126,7 @@ public:
GENDER gender;
Texturec *tex;
+ Texturec *ntex;
unsigned int randDialog;
@@ -161,14 +164,14 @@ public:
class Structures : public Entity{
public:
- void *inWorld;
- void *inside;
+ World *inWorld;
+ World *inside;
BUILD_SUB bsubtype;
Structures();
~Structures();
- unsigned int spawn(_TYPE, BUILD_SUB, float, float);
+ unsigned int spawn(_TYPE, BUILD_SUB, float, float, World *);
};
class Mob : public Entity{
diff --git a/include/world.h b/include/world.h
index 0a23965..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,14 +170,16 @@ 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 *outside,World *inside);
- void addVillage(int bCount, int npcMin, int npcMax,_TYPE t,float x,float y,World *outside,World *inside);
+ 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);
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);
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);