diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/common.hpp | 1 | ||||
-rw-r--r-- | include/entities.hpp | 12 | ||||
-rw-r--r-- | include/inventory.hpp | 12 | ||||
-rw-r--r-- | include/texture.hpp | 3 | ||||
-rw-r--r-- | include/world.hpp | 2 |
5 files changed, 27 insertions, 3 deletions
diff --git a/include/common.hpp b/include/common.hpp index 4fa74d7..f7507cb 100644 --- a/include/common.hpp +++ b/include/common.hpp @@ -238,6 +238,7 @@ extern GLint worldShader_uniform_light_color; extern GLint worldShader_uniform_light_impact; extern GLint worldShader_uniform_light_amt; +extern Color ambient; /** * Prints a formatted debug message to the console, along with the callee's file and line * number. diff --git a/include/entities.hpp b/include/entities.hpp index b04705c..826b0f6 100644 --- a/include/entities.hpp +++ b/include/entities.hpp @@ -364,7 +364,8 @@ public: float fireFlicker; vec2 fireLoc; - Light(vec2 l, Color c, float r){ + Light(vec2 l, float r, Color c) + { loc = l; color = c; radius = r; @@ -375,7 +376,14 @@ public: flame = false; } - void makeFlame(void){ + void follow(Entity *f) + { + following = f; + belongsTo = true; + } + + void makeFlame(void) + { flame = true; } diff --git a/include/inventory.hpp b/include/inventory.hpp index 1431f42..a85e537 100644 --- a/include/inventory.hpp +++ b/include/inventory.hpp @@ -185,6 +185,18 @@ public: Food* clone(); }; +class ItemLight : public Item { +private: + // the color of the light + Color color; +public: + // turn on/off the light + // TODO + int useItem(); + + ItemLight* clone(); +}; + /** * Currency class. Well, it's used for currency */ diff --git a/include/texture.hpp b/include/texture.hpp index df2a83c..95bd73b 100644 --- a/include/texture.hpp +++ b/include/texture.hpp @@ -76,6 +76,9 @@ public: return textures[index].second; } + const dim2 getTextureDim(void) { + return Texture::imageDim((*position).second); + } }; /** diff --git a/include/world.hpp b/include/world.hpp index c5730f8..fa8e4d8 100644 --- a/include/world.hpp +++ b/include/world.hpp @@ -457,7 +457,7 @@ public: void addHill(ivec2 peak, unsigned int width); // functions to add entities to the world - void addLight(vec2 xy, Color color); + void addLight(vec2 xy, float radius, Color color); void addMerchant(float x, float y, bool housed); |