From bf8596a280f067bcfc0ff81bec0e94bb860230c8 Mon Sep 17 00:00:00 2001 From: drumsetmonkey Date: Wed, 30 Mar 2016 08:49:38 -0400 Subject: Inv and textures --- include/Quest.hpp | 72 ------------------------------------ include/Texture.hpp | 103 ---------------------------------------------------- include/quest.hpp | 66 +++++++++++++++++++++++++++++++++ include/texture.hpp | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 169 insertions(+), 175 deletions(-) delete mode 100644 include/Quest.hpp delete mode 100644 include/Texture.hpp create mode 100644 include/quest.hpp create mode 100644 include/texture.hpp diff --git a/include/Quest.hpp b/include/Quest.hpp deleted file mode 100644 index eaf9426..0000000 --- a/include/Quest.hpp +++ /dev/null @@ -1,72 +0,0 @@ -/** @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 - -#include -#include - -/** - * When defined, DEBUG allows extra messages to be printed to the terminal for - * debugging purposes. - */ - -#define DEBUG - -struct need_t { - std::string name; - int n; -}; - -typedef struct { - std::string title; - std::string desc; - struct item_t reward; - std::vector need; -} Quest; - -/** - * The Quest Handler class. - * - * This class handles quests, including the assigning, dropping, and completing - * of the quests. - */ - -class QuestHandler { -public: - std::vectorcurrent; - - /** - * 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); -}; - -#endif // QUEST_H diff --git a/include/Texture.hpp b/include/Texture.hpp deleted file mode 100644 index 4202043..0000000 --- a/include/Texture.hpp +++ /dev/null @@ -1,103 +0,0 @@ -/** @file Texture.h - * @brief Defines a method for loading textures. - * - * This file gives facilities for easily loading and binding textures. - */ - -#ifndef TEXTURE_H -#define TEXTURE_H - -#include - -/** - * When defined, DEBUG allows extra messages to be printed to the terminal for - * debugging purposes. - */ - -#define DEBUG - -/** - * Texture functions are given a namespace for better organization. - */ - -namespace Texture { - - /** - * Loads a texture from the given file name, returning the GLuint used for - * later referencing of the texture. - */ - - GLuint loadTexture(std::string fileName); - - void freeTextures(void); - - void initColorIndex(); - vec2 getIndex(Color c); - dim2 imageDim(std::string fileName); -} - -/** - * The Texturec class. - * - * This class can handle an array of textures and allows easy binding of those - * textures. - */ - -class Texturec{ -private: - - /** - * Contains the index in the image array of the currently loaded texture. - */ - - unsigned int texState; - -public: - - /** - * Contains an array of the GLuints returned from Texture::loadTexture(). - */ - - std::vector image; - - /** - * Populates the image array from a list of strings, with each string as a - * separate argument. - */ - - Texturec(uint amt, ...); - - /** - * Populates the image array from an array of strings. - */ - - Texturec(uint amt,const char **paths); - Texturec(std::vectorvec); - Texturec( std::initializer_list l ); - - /** - * Frees memory taken by the image array. - */ - - ~Texturec(); - - /** - * Binds the next texture in the array, incrementing texState. - */ - - void bindNext(); - - /** - * Binds the previous texture in the array, decrementing texState. - */ - - void bindPrev(); - - /** - * Binds the texture with the provided index. - */ - - void bind(unsigned int); -}; - -#endif //TEXTURE_H diff --git a/include/quest.hpp b/include/quest.hpp new file mode 100644 index 0000000..311aade --- /dev/null +++ b/include/quest.hpp @@ -0,0 +1,66 @@ +/** @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 + +#include + +/** + * When defined, DEBUG allows extra messages to be printed to the terminal for + * debugging purposes. + */ + +#define DEBUG + +typedef struct { + std::string title; + std::string desc; + struct item_t reward; + std::vector> need; +} Quest; + +/** + * The Quest Handler class. + * + * This class handles quests, including the assigning, dropping, and completing + * of the quests. + */ + +class QuestHandler { +public: + std::vectorcurrent; + + /** + * 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); +}; + +#endif // QUEST_H diff --git a/include/texture.hpp b/include/texture.hpp new file mode 100644 index 0000000..4202043 --- /dev/null +++ b/include/texture.hpp @@ -0,0 +1,103 @@ +/** @file Texture.h + * @brief Defines a method for loading textures. + * + * This file gives facilities for easily loading and binding textures. + */ + +#ifndef TEXTURE_H +#define TEXTURE_H + +#include + +/** + * When defined, DEBUG allows extra messages to be printed to the terminal for + * debugging purposes. + */ + +#define DEBUG + +/** + * Texture functions are given a namespace for better organization. + */ + +namespace Texture { + + /** + * Loads a texture from the given file name, returning the GLuint used for + * later referencing of the texture. + */ + + GLuint loadTexture(std::string fileName); + + void freeTextures(void); + + void initColorIndex(); + vec2 getIndex(Color c); + dim2 imageDim(std::string fileName); +} + +/** + * The Texturec class. + * + * This class can handle an array of textures and allows easy binding of those + * textures. + */ + +class Texturec{ +private: + + /** + * Contains the index in the image array of the currently loaded texture. + */ + + unsigned int texState; + +public: + + /** + * Contains an array of the GLuints returned from Texture::loadTexture(). + */ + + std::vector image; + + /** + * Populates the image array from a list of strings, with each string as a + * separate argument. + */ + + Texturec(uint amt, ...); + + /** + * Populates the image array from an array of strings. + */ + + Texturec(uint amt,const char **paths); + Texturec(std::vectorvec); + Texturec( std::initializer_list l ); + + /** + * Frees memory taken by the image array. + */ + + ~Texturec(); + + /** + * Binds the next texture in the array, incrementing texState. + */ + + void bindNext(); + + /** + * Binds the previous texture in the array, decrementing texState. + */ + + void bindPrev(); + + /** + * Binds the texture with the provided index. + */ + + void bind(unsigned int); +}; + +#endif //TEXTURE_H -- cgit v1.2.3