aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/common.h3
-rw-r--r--include/config.h16
-rw-r--r--include/entities.h6
-rw-r--r--include/inventory.h2
-rw-r--r--include/quest.h (renamed from include/Quest.h)32
-rw-r--r--include/texture.h (renamed from include/Texture.h)0
-rw-r--r--include/world.h13
7 files changed, 35 insertions, 37 deletions
diff --git a/include/common.h b/include/common.h
index 6f453b0..216dc01 100644
--- a/include/common.h
+++ b/include/common.h
@@ -117,7 +117,7 @@ typedef col Color;
* Define the game's name (displayed in the window title).
*/
-#define GAME_NAME "Independent Study v.0.6 alpha - NOW WITH more c++"
+#define GAME_NAME "Independent Study v0.7 alpha - NOW WITH lights and snow and stuff"
/**
* The desired width of the game window.
@@ -176,6 +176,7 @@ extern float VOLUME_SFX;
*/
#define DEBUG_printf( message, ...) DEBUG_prints(__FILE__, __LINE__, message, __VA_ARGS__ )
+#define C(x) std::cout << x << std::endl;
/**
* Defines pi for calculations that need it.
diff --git a/include/config.h b/include/config.h
index 4d56d9c..e2f7239 100644
--- a/include/config.h
+++ b/include/config.h
@@ -1,14 +1,10 @@
#ifndef CONFIG_H
#define CONFIG_H
-#include <iostream>
-#include <SDL2/SDL_mixer.h>
-#include <tinyxml2.h>
+namespace config {
+ void read( void );
+ void update( void );
+ void save( void );
+}
-void readConfig(void);
-
-void updateConfig(void);
-
-void saveConfig();
-
-#endif //CONFIG_H \ No newline at end of file
+#endif //CONFIG_H
diff --git a/include/entities.h b/include/entities.h
index 1250708..f455726 100644
--- a/include/entities.h
+++ b/include/entities.h
@@ -2,9 +2,9 @@
#define ENTITIES_H
#include <common.h>
-#include <Quest.h>
+#include <quest.h>
#include <inventory.h>
-#include <Texture.h>
+#include <texture.h>
#include <sstream>
@@ -14,7 +14,7 @@
#define Structurep(n) ((Structures *)n)
#define Mobp(n) ((Mob *)n)
-#define PLAYER_INV_SIZE 30 // The size of the player's inventory
+#define PLAYER_INV_SIZE 43 // The size of the player's inventory
#define NPC_INV_SIZE 3 // Size of an NPC's inventory
enum _TYPE {
diff --git a/include/inventory.h b/include/inventory.h
index 7369642..08a145e 100644
--- a/include/inventory.h
+++ b/include/inventory.h
@@ -4,7 +4,7 @@
#include <common.h>
#include <string.h>
-#include <Texture.h>
+#include <texture.h>
#define DEBUG
diff --git a/include/Quest.h b/include/quest.h
index 8b1e142..4da38bf 100644
--- a/include/Quest.h
+++ b/include/quest.h
@@ -1,16 +1,15 @@
/** @file Quest.h
* @brief The quest handling system.
- *
+ *
* This file contains Quest and QuestHandler, used to manage quests inside the
* game.
*/
-
+
#ifndef QUEST_H
#define QUEST_H
-#include <cstring>
+#include <string>
-#include <common.h>
#include <inventory.h>
/**
@@ -20,21 +19,16 @@
#define DEBUG
-struct need_t {
- std::string name;
- int n;
-};
-
typedef struct {
std::string title;
std::string desc;
struct item_t reward;
- std::vector<struct need_t> need;
+ std::vector<std::pair<std::string,int>> need;
} Quest;
/**
* The Quest Handler class.
- *
+ *
* This class handles quests, including the assigning, dropping, and completing
* of the quests.
*/
@@ -42,30 +36,30 @@ typedef struct {
class QuestHandler {
public:
std::vector<Quest>current;
-
+
/**
* Adds a quest to the current quest vector by its title.
*/
-
+
int assign(std::string title,std::string desc,std::string req);
-
+
/**
* Drops a quest through its title.
*/
-
+
int drop(std::string title);
-
+
/**
* Finishes a quest through it's title, also giving a pointer to the Entity
* that gave the quest originally.
*/
-
+
int finish(std::string t);
-
+
/**
* Returns true if this handler is currently taking the quest.
*/
-
+
bool hasQuest(std::string t);
};
diff --git a/include/Texture.h b/include/texture.h
index 816a8bf..816a8bf 100644
--- a/include/Texture.h
+++ b/include/texture.h
diff --git a/include/world.h b/include/world.h
index 0b87134..f730715 100644
--- a/include/world.h
+++ b/include/world.h
@@ -165,7 +165,7 @@ protected:
* World::detect(), which is why it is declared private.
*/
- void singleDetect( Entity *e );
+ virtual void singleDetect( Entity *e );
/**
* Empties all entity vectors.
@@ -386,7 +386,7 @@ public:
* half-width to positive half-width.
*/
- virtual void generate(unsigned int width);
+ void generate(unsigned int width);
/**
* Sets the background theme, collecting the required textures into a
@@ -482,11 +482,18 @@ public:
*/
class IndoorWorld : public World {
+private:
+
+ std::vector<std::vector<float>> floor;
+
+ void singleDetect( Entity *e );
+
public:
IndoorWorld(void);
~IndoorWorld(void);
- void generate(unsigned int width); // Generates a flat world of width 'width'
+ void addFloor( unsigned int width );
+
void draw(Player *p); // Draws the world (ignores layers)
};