Skip to content

Commit

Permalink
Adjust texture size to avoid textures that are way too large for a gi…
Browse files Browse the repository at this point in the history
…ven tileset
  • Loading branch information
Leeor Dicker committed Jul 1, 2023
1 parent ebe68d0 commit da5ed04
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion OP2-Landlord/Graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,10 @@ Graphics::Texture Graphics::loadTexturePacked(const void* buffer, const size_t b
{
SdlSurface src{ SDL_ConvertSurfaceFormat(createSurfaceFromBuffer(buffer, buffersize).get(), SDL_PIXELFORMAT_RGB888, 0) };

const int textureSize = src->h / 32 > 256 ? 1024 : 512;
SdlSurface destinationSurface(SDL_CreateRGBSurface(
src.get()->flags,
1024, 1024,
textureSize, textureSize / 2,
src->format->BitsPerPixel,
src->format->Rmask,
src->format->Gmask,
Expand Down

0 comments on commit da5ed04

Please sign in to comment.