aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authordrumsetmonkey <abelleisle@roadrunner.com>2016-01-03 21:46:03 -0500
committerdrumsetmonkey <abelleisle@roadrunner.com>2016-01-03 21:46:03 -0500
commit5c7c99ac5fe1158adbdf0469fb36ddd153511f5d (patch)
tree1c50bda4f3e4a530fde7f97169dbd52a004d903a /include
parent1ccd85fd022ab5d628c9e26a213e47cf2687fce7 (diff)
parent272a152b54a198a84f122ab8bedb1019708b7008 (diff)
shit
Diffstat (limited to 'include')
-rw-r--r--include/common.h32
-rw-r--r--include/entities.h11
-rw-r--r--include/ui.h11
-rw-r--r--include/world.h10
4 files changed, 54 insertions, 10 deletions
diff --git a/include/common.h b/include/common.h
index 31126d7..5713c56 100644
--- a/include/common.h
+++ b/include/common.h
@@ -70,7 +70,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.
@@ -142,6 +142,23 @@ extern vec2 offset;
extern unsigned int loops;
/**
+ * This class contains a string for identification and a value. It can be used to
+ * save certain events for and decisions so that they can be recalled later.
+ */
+
+class Condition {
+private:
+ char *id;
+ void *value;
+public:
+ Condition(const char *_id,void *val);
+ ~Condition();
+
+ bool sameID(const char *s);
+ void *getValue(void);
+};
+
+/**
* Prints a formatted debug message to the console, along with the callee's file and line
* number.
*/
@@ -160,4 +177,17 @@ void safeSetColor(int r,int g,int b);
void safeSetColorA(int r,int g,int b,int a);
+/**
+ * We've encountered many problems when attempting to create delays for triggering
+ * the logic function. As a result, we decided on using the timing libraries given
+ * by <chrono> in the standard C++ library. This function simply returns the amount
+ * of milliseconds that have passed sine the epoch.
+ */
+
+#ifdef __WIN32__
+#define millis() SDL_GetTicks()
+#else
+unsigned int millis(void);
+#endif // __WIN32__
+
#endif // COMMON_H
diff --git a/include/entities.h b/include/entities.h
index 1abe886..6b8cc32 100644
--- a/include/entities.h
+++ b/include/entities.h
@@ -32,7 +32,8 @@ enum MOB_SUB {
MS_RABBIT = 1,
MS_BIRD,
MS_TRIGGER,
- MS_DOOR
+ MS_DOOR,
+ MS_PAGE
};
enum BUILD_SUB{
@@ -44,6 +45,8 @@ enum BUILD_SUB{
FOUNTAIN
};
+class World;
+
class Particles{
public:
vec2 loc;
@@ -162,14 +165,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/ui.h b/include/ui.h
index 5d17c47..6a81dab 100644
--- a/include/ui.h
+++ b/include/ui.h
@@ -1,3 +1,7 @@
+/** @file ui.h
+ * @brief Contains functions for handling the user interface.
+ */
+
#ifndef UI_H
#define UI_H
@@ -12,9 +16,9 @@
namespace ui {
- /*
- * Contains the coordinates of the mouse in the window.
- */
+ /**
+ * Contains the coordinates of the mouse inside the window.
+ */
extern vec2 mouse;
@@ -90,6 +94,7 @@ namespace ui {
void toggleWhiteFast(void);
void waitForCover(void);
+ void waitForNothing(unsigned int);
}
#endif // UI_H
diff --git a/include/world.h b/include/world.h
index 0a23965..98ca54a 100644
--- a/include/world.h
+++ b/include/world.h
@@ -166,13 +166,19 @@ public:
std::vector<Object *> object;
std::vector<Particles *> particles;
- 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);
+
+ NPC *getAvailableNPC(void);
+
+ /*
+ * Update coordinates of all entities.
+ */
void update(Player *p,unsigned int delta);