diff options
Diffstat (limited to 'src/texture.cpp')
-rw-r--r-- | src/texture.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/texture.cpp b/src/texture.cpp index 5723bd8..44e48a0 100644 --- a/src/texture.cpp +++ b/src/texture.cpp @@ -6,6 +6,7 @@ #include <SDL2/SDL_image.h> +#include <config.hpp> #include <debug.hpp> #include <error.hpp> @@ -37,6 +38,13 @@ Texture::Texture(const std::string& file, const GLuint& t, const vec2& v) loadTexture(file, *this); } +Texture::Texture(const std::string& file, bool hline) +{ + loadTexture(file, *this); + if (hline) + dim /= game::HLINE; +} + const std::string& Texture::getName(void) const { return name; @@ -80,8 +88,7 @@ void loadTexture(const std::string& file, Texture& texture) if (preloaded == std::end(loadedTextures)) { auto image = IMG_Load(file.c_str()); - if (image == nullptr) - UserError("File not found: " + file); + UserAssert(image != nullptr, "File not found: " + file); #ifdef DEBUG DEBUG_printf("Loaded image file: %s\n", file.c_str()); |