Sprite: Don't allocate sprite encode space for map-mode zoom levels
This commit is contained in:
@@ -286,7 +286,7 @@ template <bool Tpal_to_rgb> Sprite *Blitter_32bppOptimized::EncodeInternal(const
|
||||
/* streams of pixels (a, r, g, b channels)
|
||||
*
|
||||
* stored in separated stream so data are always aligned on 4B boundary */
|
||||
Colour *dst_px_orig[ZOOM_LVL_COUNT];
|
||||
Colour *dst_px_orig[ZOOM_LVL_SPR_COUNT];
|
||||
|
||||
/* interleaved stream of 'm' channel and 'n' channel
|
||||
* 'n' is number of following pixels with the same alpha channel class
|
||||
@@ -294,10 +294,10 @@ template <bool Tpal_to_rgb> Sprite *Blitter_32bppOptimized::EncodeInternal(const
|
||||
*
|
||||
* it has to be stored in one stream so fewer registers are used -
|
||||
* x86 has problems with register allocation even with this solution */
|
||||
uint16 *dst_n_orig[ZOOM_LVL_COUNT];
|
||||
uint16 *dst_n_orig[ZOOM_LVL_SPR_COUNT];
|
||||
|
||||
/* lengths of streams */
|
||||
uint32 lengths[ZOOM_LVL_COUNT][2];
|
||||
uint32 lengths[ZOOM_LVL_SPR_COUNT][2];
|
||||
|
||||
ZoomLevel zoom_min;
|
||||
ZoomLevel zoom_max;
|
||||
|
@@ -18,7 +18,7 @@ public:
|
||||
/** Data stored about a (single) sprite. */
|
||||
struct SpriteData {
|
||||
BlitterSpriteFlags flags;
|
||||
uint32 offset[ZOOM_LVL_COUNT][2]; ///< Offsets (from .data) to streams for different zoom levels, and the normal and remap image information.
|
||||
uint32 offset[ZOOM_LVL_SPR_COUNT][2]; ///< Offsets (from .data) to streams for different zoom levels, and the normal and remap image information.
|
||||
byte data[]; ///< Data, all zoomlevels.
|
||||
};
|
||||
|
||||
|
@@ -30,8 +30,8 @@ Sprite *Blitter_32bppSSE_Base::Encode(const SpriteLoader::Sprite *sprite, Alloca
|
||||
ZoomLevel zoom_max = ZOOM_LVL_NORMAL;
|
||||
if (sprite->type != SpriteType::Font) {
|
||||
zoom_min = _settings_client.gui.zoom_min;
|
||||
zoom_max = _settings_client.gui.zoom_max;
|
||||
if (zoom_max == zoom_min) zoom_max = ZOOM_LVL_MAX;
|
||||
zoom_max = (ZoomLevel) std::min(_settings_client.gui.zoom_max, ZOOM_LVL_DRAW_SPR);
|
||||
if (zoom_max == zoom_min) zoom_max = ZOOM_LVL_DRAW_SPR;
|
||||
}
|
||||
|
||||
/* Calculate sizes and allocate. */
|
||||
|
@@ -60,7 +60,7 @@ public:
|
||||
};
|
||||
struct SpriteData {
|
||||
BlitterSpriteFlags flags;
|
||||
SpriteInfo infos[ZOOM_LVL_COUNT];
|
||||
SpriteInfo infos[ZOOM_LVL_SPR_COUNT];
|
||||
byte data[]; ///< Data, all zoomlevels.
|
||||
};
|
||||
|
||||
|
@@ -18,7 +18,7 @@ class Blitter_8bppOptimized FINAL : public Blitter_8bppBase {
|
||||
public:
|
||||
/** Data stored about a (single) sprite. */
|
||||
struct SpriteData {
|
||||
uint32 offset[ZOOM_LVL_COUNT]; ///< Offsets (from .data) to streams for different zoom levels.
|
||||
uint32 offset[ZOOM_LVL_SPR_COUNT]; ///< Offsets (from .data) to streams for different zoom levels.
|
||||
byte data[]; ///< Data, all zoomlevels.
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user