diff --git a/source/sprite_appearances.cpp b/source/sprite_appearances.cpp index 4303395e..0617ab3e 100644 --- a/source/sprite_appearances.cpp +++ b/source/sprite_appearances.cpp @@ -266,7 +266,7 @@ SpritePtr SpriteAppearances::getSprite(int spriteId) { } // Retrieve sprite sheet - const auto& sheet = getSheetBySpriteId(spriteId); + const auto &sheet = getSheetBySpriteId(spriteId); if (!sheet || !sheet->loaded) { spdlog::warn("Sprite sheet for sprite {} is not loaded or null.", spriteId); return nullptr; @@ -319,8 +319,7 @@ SpritePtr SpriteAppearances::getSprite(int spriteId) { // Validate pixel buffer size size_t pixelBufferSize = sprite->pixels.size(); if (pixelBufferSize < static_cast(spriteWidth * spriteHeight * 4)) { - spdlog::error("Insufficient pixel buffer size for sprite {}: pixelBufferSize = {}, expected = {}", - spriteId, pixelBufferSize, spriteWidth * spriteHeight * 4); + spdlog::error("Insufficient pixel buffer size for sprite {}: pixelBufferSize = {}, expected = {}", spriteId, pixelBufferSize, spriteWidth * spriteHeight * 4); return nullptr; } @@ -332,8 +331,7 @@ SpritePtr SpriteAppearances::getSprite(int spriteId) { // Validate access if (bufferDataStart + spriteWidthBytes > bufferSize) { - spdlog::error("Out-of-bounds access during copy: spriteId = {}, height = {}, offset = {}, bufferDataStart = {}, bufferSize = {}", - spriteId, height, offset, bufferDataStart, bufferSize); + spdlog::error("Out-of-bounds access during copy: spriteId = {}, height = {}, offset = {}, bufferDataStart = {}, bufferSize = {}", spriteId, height, offset, bufferDataStart, bufferSize); return nullptr; } diff --git a/source/sprite_appearances.h b/source/sprite_appearances.h index ff0c4e8c..3c5f32a1 100644 --- a/source/sprite_appearances.h +++ b/source/sprite_appearances.h @@ -30,7 +30,7 @@ class GameSprite; #define SPRITE_SHEET_WIDTH 384 #define SPRITE_SHEET_HEIGHT 384 -#define BYTES_IN_SPRITE_SHEET SPRITE_SHEET_WIDTH * SPRITE_SHEET_WIDTH * 4 +#define BYTES_IN_SPRITE_SHEET SPRITE_SHEET_WIDTH* SPRITE_SHEET_WIDTH * 4 #define SPRITE_SHEET_WIDTH_BYTES SPRITE_SHEET_WIDTH * 4 enum class SpriteLayout {