diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-15 20:39:07 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-15 20:39:07 +0100 |
commit | e8cd950b8ebd152d76d588d4fedc7f4c239b0835 (patch) | |
tree | 7919d13a79d52f1365bc19bf1b435a6264ee5512 /mwe/resource-manager/TextureMap.cpp | |
parent | 5bee4515c1089ce3499bc3b74780db94f0c02306 (diff) | |
parent | 9f6475e7b0698c414138e2a8140b47f01ce9c5d1 (diff) |
merge `master` into `loek/cleanup`
Diffstat (limited to 'mwe/resource-manager/TextureMap.cpp')
-rw-r--r-- | mwe/resource-manager/TextureMap.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/mwe/resource-manager/TextureMap.cpp b/mwe/resource-manager/TextureMap.cpp index d82975c..284f8a8 100644 --- a/mwe/resource-manager/TextureMap.cpp +++ b/mwe/resource-manager/TextureMap.cpp @@ -15,8 +15,7 @@ TextureMap::~TextureMap() { } //public -bool TextureMap::loadFromFile(const std::string & path, - SDL_Renderer * renderer) { +bool TextureMap::loadFromFile(const std::string & path, SDL_Renderer * renderer) { assert(renderer != nullptr); assert(!path.empty()); @@ -34,12 +33,11 @@ bool TextureMap::loadFromFile(const std::string & path, constexpr std::int32_t bmask = 0x00ff0000; const std::int32_t amask = c == 4 ? 0xff000000 : 0; - auto * surface = SDL_CreateRGBSurfaceFrom(data, x, y, c * 8, pitch, - rmask, gmask, bmask, amask); + auto * surface + = SDL_CreateRGBSurfaceFrom(data, x, y, c * 8, pitch, rmask, gmask, bmask, amask); if (!surface) { - std::cerr << "Unable to create texture surface: " << SDL_GetError() - << "\n"; + std::cerr << "Unable to create texture surface: " << SDL_GetError() << "\n"; stbi_image_free(data); return false; } |