Sprite cache: Allow caching only required subset of sprite zoom levels

Enable for blitters based on 32bpp_optimized or SSE
This commit is contained in:
Jonathan G Rennison
2023-08-22 22:16:04 +01:00
parent 785216db73
commit 46f5fb9f25
28 changed files with 423 additions and 172 deletions

View File

@@ -1286,7 +1286,7 @@ struct SpriteAlignerWindow : Window {
void SetStringParameters(int widget) const override
{
const Sprite *spr = GetSprite(this->current_sprite, SpriteType::Normal);
const Sprite *spr = GetSprite(this->current_sprite, SpriteType::Normal, ZoomMask(ZOOM_LVL_GUI));
switch (widget) {
case WID_SA_CAPTION:
SetDParam(0, this->current_sprite);
@@ -1341,7 +1341,7 @@ struct SpriteAlignerWindow : Window {
switch (widget) {
case WID_SA_SPRITE: {
/* Center the sprite ourselves */
const Sprite *spr = GetSprite(this->current_sprite, SpriteType::Normal);
const Sprite *spr = GetSprite(this->current_sprite, SpriteType::Normal, ZoomMask(ZOOM_LVL_GUI));
Rect ir = r.Shrink(WidgetDimensions::scaled.bevel);
int x;
int y;
@@ -1437,7 +1437,7 @@ struct SpriteAlignerWindow : Window {
* used by someone and the sprite cache isn't big enough for that
* particular NewGRF developer.
*/
Sprite *spr = const_cast<Sprite *>(GetSprite(this->current_sprite, SpriteType::Normal));
Sprite *spr = const_cast<Sprite *>(GetSprite(this->current_sprite, SpriteType::Normal, 0));
/* Remember the original offsets of the current sprite, if not already in mapping. */
if (this->offs_start_map.count(this->current_sprite) == 0) {