diff options
author | drumsetmonkey <abelleisle@roadrunner.com> | 2016-04-28 10:31:16 -0400 |
---|---|---|
committer | drumsetmonkey <abelleisle@roadrunner.com> | 2016-04-28 10:31:16 -0400 |
commit | 2e026aff928b30267a39ef6fdeec3e43e9f106e6 (patch) | |
tree | b787550264cb3f1a88401f0240968c99b5138237 /src/texture.cpp | |
parent | 53800e07513f4a625ba70ff7d805d158a6b42121 (diff) |
New inventory system
Diffstat (limited to 'src/texture.cpp')
-rw-r--r-- | src/texture.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/texture.cpp b/src/texture.cpp index 86038e2..d457831 100644 --- a/src/texture.cpp +++ b/src/texture.cpp @@ -170,26 +170,31 @@ Texturec::Texturec(uint amt, ...) { va_list fNames; texState = 0; va_start(fNames, amt); - for(unsigned int i = 0; i < amt; i++) - image.push_back(Texture::loadTexture(va_arg(fNames, char *))); + for (unsigned int i = 0; i < amt; i++) { + std::string l = va_arg(fNames, char *); + image.push_back(Texture::loadTexture(l)); + texLoc.push_back(l); + } va_end(fNames); } Texturec::Texturec(std::initializer_list<std::string> l) { texState = 0; - std::for_each(l.begin(), l.end(), [&](std::string s) { image.push_back(Texture::loadTexture(s)); }); + std::for_each(l.begin(), l.end(), [&](std::string s) { image.push_back(Texture::loadTexture(s)); texLoc.push_back(s);}); } Texturec::Texturec(std::vector<std::string>v) { texState = 0; - std::for_each(v.begin(), v.end(), [&](std::string s) { image.push_back(Texture::loadTexture(s)); }); + std::for_each(v.begin(), v.end(), [&](std::string s) { image.push_back(Texture::loadTexture(s)); texLoc.push_back(s);}); } Texturec::Texturec(uint amt,const char **paths) { texState = 0; - for(unsigned int i = 0; i < amt; i++) + for (unsigned int i = 0; i < amt; i++) { image.push_back(Texture::loadTexture(paths[i])); + texLoc.push_back(paths[i]); + } } Texturec::~Texturec() { |