diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-15 20:03:51 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-11-15 20:03:51 +0100 |
commit | 9f6475e7b0698c414138e2a8140b47f01ce9c5d1 (patch) | |
tree | 3dd74938da60a0de1a77360280c15ff8949d02cf /mwe/resource-manager/TextureMap.cpp | |
parent | 424611c6016e4a189e3a887fabe8e45b637e80f4 (diff) | |
parent | b597af6c64ccf50c7f92a2b78e7950ee3ab230f7 (diff) |
Merge branch 'loek/wrap'
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; } |