aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authordrumsetmonkey <abelleisle@roadrunner.com>2016-01-07 08:48:03 -0500
committerdrumsetmonkey <abelleisle@roadrunner.com>2016-01-07 08:48:03 -0500
commit42bd0ae7913af00ea5e330e45321e2bbe9e734d9 (patch)
tree0e420156d2cb71607a1df0aa541a02b0db35a6cb /include
parenta85accc62dab6d3edc4fb4ffb991ce4c537394f6 (diff)
parent81cf23371b94baf608c98d0dd248acfbbd5d2c70 (diff)
Merge branch 'master' of http://github.com/tcsullivan/gamedev
Diffstat (limited to 'include')
-rw-r--r--include/common.h2
-rw-r--r--include/entities.h42
2 files changed, 36 insertions, 8 deletions
diff --git a/include/common.h b/include/common.h
index 0c4d700..0a868df 100644
--- a/include/common.h
+++ b/include/common.h
@@ -77,7 +77,7 @@ typedef struct{
* The desired width of the game window.
*/
-#define SCREEN_WIDTH 1280
+#define SCREEN_WIDTH 1024
/**
* The desired height of the game window.
diff --git a/include/entities.h b/include/entities.h
index 90af0f2..0fcc662 100644
--- a/include/entities.h
+++ b/include/entities.h
@@ -66,7 +66,7 @@ typedef struct {
_TYPE type;
GENDER gender;
size_t nameSize;
- //char *name;
+ char name[32];
//Texturec *tex;
} __attribute__ ((packed)) EntitySavePacket;
@@ -180,10 +180,6 @@ public:
void interact();
};
-typedef struct {
- EntitySavePacket esp;
-} __attribute__ ((packed)) NPCSavePacket;
-
class NPC : public Entity{
public:
std::vector<int (*)(NPC *)>aiFunc;
@@ -196,9 +192,16 @@ public:
void wander(int);
char *save(unsigned int *size);
- void load(char *b);
+ void load(unsigned int,char *b);
};
+typedef struct {
+ EntitySavePacket esp;
+ World *inWorld;
+ World *inside;
+ BUILD_SUB bsubtype;
+} __attribute__ ((packed)) StructuresSavePacket;
+
class Structures : public Entity{
public:
World *inWorld;
@@ -209,6 +212,9 @@ public:
~Structures();
unsigned int spawn(_TYPE, BUILD_SUB, float, float, World *);
+
+ char *save(void);
+ void load(char *s);
};
class Mob : public Entity{
@@ -221,19 +227,41 @@ public:
~Mob();
void wander(int);
+
+ char *save(void);
+ void load(char *);
};
+typedef struct {
+ EntitySavePacket esp;
+ double init_y;
+ //void (*hey)(Mob *callee);
+} __attribute__ ((packed)) MobSavePacket;
+
+typedef struct {
+ EntitySavePacket esp;
+ ITEM_ID identifier;
+ bool questObject;
+ char pickupDialog[256];
+} __attribute__ ((packed)) ObjectSavePacket;
+
class Object : public Entity{
private:
- int identifier;
+ ITEM_ID identifier;
public:
char *pickupDialog;
bool questObject = false;
+ Object();
Object(ITEM_ID id, bool qo, const char *pd);
~Object();
+ void reloadTexture(void);
+
void interact(void);
+
+ char *save(void);
+ void load(char *);
};
#endif // ENTITIES_H