aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/common.h5
-rw-r--r--include/inventory.h7
-rw-r--r--include/ui.h6
-rw-r--r--include/world.h2
4 files changed, 14 insertions, 6 deletions
diff --git a/include/common.h b/include/common.h
index 3015b11..ed2ed9e 100644
--- a/include/common.h
+++ b/include/common.h
@@ -41,8 +41,6 @@ enum GENDER{
template<typename T, size_t N> //this fuction returns the size of any array
int eAmt(T (&)[N]){return N;}
-GLuint loadTexture(const char *fileName);
-
extern bool gameRunning;
extern unsigned int deltaTime;
extern unsigned int loops;
@@ -53,4 +51,7 @@ extern FILE* names;
extern Mix_Music *music;
extern Mix_Chunk *horn;
+GLuint loadTexture(const char *fileName);
+void DEBUG_printf(const char *s,...);
+
#endif // COMMON_H
diff --git a/include/inventory.h b/include/inventory.h
index 8f42cc5..d68fed9 100644
--- a/include/inventory.h
+++ b/include/inventory.h
@@ -3,8 +3,11 @@
#include <cstdlib>
+#define DEBUG
+
enum ITEM_ID { // Contains item IDs for every item in the game, this is how items are stored. IDs are also used to lookup item strings
- TEST_ITEM = 1 // A test item (duh)
+ TEST_ITEM = 1, // A test item (duh)
+ SWORD_ITEM
};
struct item_t { // Used to define entries in an entity's inventory
@@ -26,4 +29,6 @@ public:
void draw(void); // Draws a text list of items in this inventory (should only be called for the player for now)
};
+unsigned int initInventorySprites(void); // Loads as many inventory textures as it can find, returns count
+
#endif // INVENTORY_H
diff --git a/include/ui.h b/include/ui.h
index 5304c1b..6f23a78 100644
--- a/include/ui.h
+++ b/include/ui.h
@@ -4,6 +4,8 @@
#include <common.h>
#include <cstdarg> // For putText()
+#define DEBUG
+
namespace ui { // Functions are kept in a namespace simply
// for organization
@@ -18,9 +20,9 @@ namespace ui { // Functions are kept in a namespace simply
void setFontFace(const char *ttf); // Checks and unpacks the TTF file for use by putString() and putText()
void setFontSize(unsigned int size); // Sets the size of the currently loaded font to 'size' pixels
- void putString(const float x,const float y,const char *s); // Draws the string 's' to the coordinates ('x','y'). The height (and therefore the width)
+ float putString(const float x,const float y,const char *s); // Draws the string 's' to the coordinates ('x','y'). The height (and therefore the width)
// are determined by what's currently set by setFontSize()
- void putText(const float x,const float y,const char *str,...); // Draws the formatted string 'str' using putString()
+ float putText(const float x,const float y,const char *str,...); // Draws the formatted string 'str' using putString()
void dialogBox(const char *name,const char *text,...); // Prepares a dialog box to be drawn (its drawn as a black background at the top of the
// screen and then 'text' is putString()'d
diff --git a/include/world.h b/include/world.h
index 1f8b7e1..4acb9ee 100644
--- a/include/world.h
+++ b/include/world.h
@@ -28,13 +28,13 @@ protected:
float y,gh[2];
unsigned char color;
} __attribute__ ((packed)) *line;
- unsigned int lineCount; // Size of the array 'line' (aka the width of the world)
std::vector<Platform> platform; // An array (vector thing) of platforms
int x_start; // Worlds are centered on the x axis (0,n), this contains
// where to start drawing the world to have it centered properly.
World *behind,*infront; // Pointers to other areas of land that are behind or in front of this one, respectively.
void singleDetect(Entity *e); // Handles an individual entity (gravity n' stuff)
public:
+ unsigned int lineCount; // Size of the array 'line' (aka the width of the world)
World *toLeft,*toRight; // Pointers to areas to the left and right of this world. These are made public
// so that they can easily be set without a function.