diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-18 15:08:31 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-11-18 15:08:31 +0100 |
commit | fee42c67918a9370f7f4e074dba9a677afccf90b (patch) | |
tree | c5ed200e3c584fafc4c6bd3df48adeed3cfbd31d /mwe/resource-manager/TextureMap.cpp | |
parent | ed1403aea4412bd479244eae8e2940190e71cd28 (diff) | |
parent | 121b64b1cb6cfead5814070c8b0185d3d7308095 (diff) |
Merge remote-tracking branch 'origin/master' into niels/RenderingParticle
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; } |