diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/Texture.h | 4 | ||||
-rw-r--r-- | include/common.h | 22 | ||||
-rw-r--r-- | include/entities.h | 3 | ||||
-rw-r--r-- | include/inventory.h | 14 | ||||
-rw-r--r-- | include/world.h | 17 |
5 files changed, 11 insertions, 49 deletions
diff --git a/include/Texture.h b/include/Texture.h index a3f242b..c590f6a 100644 --- a/include/Texture.h +++ b/include/Texture.h @@ -11,12 +11,12 @@ namespace Texture{ class Texturec{ private: - int texState; + unsigned int texState; public: Texturec(uint amt, ...); void bindNext(); void bindPrev(); - void bind(int); + void bind(unsigned int); void walk(); GLuint *image; diff --git a/include/common.h b/include/common.h index 525a4cd..0ddb5e4 100644 --- a/include/common.h +++ b/include/common.h @@ -9,8 +9,7 @@ #include <cstdlib> #include <vector> #include <math.h> - #include <thread> - +#include <thread> /* * Include GLEW and the SDL 2 headers @@ -60,10 +59,10 @@ typedef struct { * and whether or not we want the window to be fullscreen. */ -#define GAME_NAME "Independent Study v.0.3 alpha" +#define GAME_NAME "Independent Study v.0.4 alpha" -#define SCREEN_WIDTH 1792 -#define SCREEN_HEIGHT 1008 +#define SCREEN_WIDTH 800 +#define SCREEN_HEIGHT 600 //#define FULLSCREEN @@ -118,14 +117,6 @@ extern vec2 offset; extern float handAngle; /* - * Loads an image from the given file path and attempts to make a texture out of it. The - * resulting GLuint is returned (used to recall the texture in glBindTexture). - * -*/ - -//GLuint loadTexture(const char *fileName); - -/* * Prints a formatted debug message to the console, along with the callee's file and line * number. * @@ -136,9 +127,4 @@ void DEBUG_prints(const char* file, int line, const char *s,...); void safeSetColor(int r,int g,int b); void safeSetColorA(int r,int g,int b,int a); -unsigned int safe_strlen(const char*); - -void DrawCircle(float cx, float cy, float r, int num_segments); - - #endif // COMMON_H diff --git a/include/entities.h b/include/entities.h index be5c000..b9881ea 100644 --- a/include/entities.h +++ b/include/entities.h @@ -112,8 +112,7 @@ public: class Object : public Entity{ public: - Object(int); - Object(int, bool, char*); + Object(ITEM_ID id, bool qo, const char *pd); void interact(void); bool questObject = false; char *pickupDialog; diff --git a/include/inventory.h b/include/inventory.h index 2793ad7..a9a4bcb 100644 --- a/include/inventory.h +++ b/include/inventory.h @@ -50,18 +50,7 @@ public: char* textureLoc; Texturec *tex; int count; - Item(ITEM_ID i, char* n, ITEM_TYPE t, float w, float h, int m, char* tl): - id(i), type(t), width(w), height(h), maxStackSize(m){ - count = 0; - - name = (char*)calloc(strlen(n ),sizeof(char)); - textureLoc = (char*)calloc(strlen(tl),sizeof(char)); - - strcpy(name,n); - strcpy(textureLoc,tl); - - tex= new Texturec(1,textureLoc); - } + Item(ITEM_ID i, const char *n, ITEM_TYPE t, float w, float h, int m, const char *tl); GLuint rtex(){ return tex->image[0]; } @@ -101,5 +90,6 @@ public: }; void itemUse(void *p); +char *getItemTexturePath(ITEM_ID id); #endif // INVENTORY_H diff --git a/include/world.h b/include/world.h index 4c82b2c..a2414e6 100644 --- a/include/world.h +++ b/include/world.h @@ -1,7 +1,7 @@ #ifndef WORLD_H #define WORLD_H -#include <common.h> // For HLINE, vec2, OpenGL utilities, etc. +#include <common.h> // For HLINE, vec2, OpenGL utilities, etc. #include <entities.h> #define GEN_INC 10 // Defines at what interval y values should be calculated for the array 'line'. @@ -102,7 +102,7 @@ public: void addMob(int t,float x,float y); void addMob(int t,float x,float y,void (*hey)()); void addNPC(float x,float y); - void addObject(int, bool, char*, float, float); + void addObject(ITEM_ID, bool, const char *, float, float); void update(Player *p,unsigned int delta); @@ -176,19 +176,6 @@ public: int getTheWidth(void); - /* - * Stores all of this class's contents in a string for saving to a file. This array should - * be freed after being written to a file. - */ - - char *save(unsigned int *ssize); - - /* - * Loads a previous world's contents (from save()) into this one. - */ - - void load(char *buf); - }; /* |