mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-22 15:23:01 +01:00
Fix #15006: Prevent allocating empty texture atlases
This commit is contained in:
@@ -101,8 +101,8 @@ public:
|
|||||||
_atlasWidth = atlasWidth;
|
_atlasWidth = atlasWidth;
|
||||||
_atlasHeight = atlasHeight;
|
_atlasHeight = atlasHeight;
|
||||||
|
|
||||||
_cols = _atlasWidth / _imageSize;
|
_cols = std::max(1, _atlasWidth / _imageSize);
|
||||||
_rows = _atlasHeight / _imageSize;
|
_rows = std::max(1, _atlasHeight / _imageSize);
|
||||||
|
|
||||||
_freeSlots.resize(_cols * _rows);
|
_freeSlots.resize(_cols * _rows);
|
||||||
for (size_t i = 0; i < _freeSlots.size(); i++)
|
for (size_t i = 0; i < _freeSlots.size(); i++)
|
||||||
|
|||||||
Reference in New Issue
Block a user