mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-20 13:09:15 +00:00
Codechange: Make SpriteType, CargoSortType, SourceType and ScriptType enum classes. (#10663)
This avoids a (soft) namespace conflict between the four ST_* enums.
This commit is contained in:
@@ -293,7 +293,7 @@ template <bool Tpal_to_rgb> Sprite *Blitter_32bppOptimized::EncodeInternal(const
|
||||
ZoomLevel zoom_min;
|
||||
ZoomLevel zoom_max;
|
||||
|
||||
if (sprite->type == ST_FONT) {
|
||||
if (sprite->type == SpriteType::Font) {
|
||||
zoom_min = ZOOM_LVL_NORMAL;
|
||||
zoom_max = ZOOM_LVL_NORMAL;
|
||||
} else {
|
||||
|
@@ -28,7 +28,7 @@ Sprite *Blitter_32bppSSE_Base::Encode(const SpriteLoader::Sprite *sprite, Alloca
|
||||
*/
|
||||
ZoomLevel zoom_min = ZOOM_LVL_NORMAL;
|
||||
ZoomLevel zoom_max = ZOOM_LVL_NORMAL;
|
||||
if (sprite->type != ST_FONT) {
|
||||
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;
|
||||
|
@@ -354,7 +354,7 @@ void Blitter_40bppAnim::DrawColourMappingRect(void *dst, int width, int height,
|
||||
anim = anim - width + _screen.pitch;
|
||||
} while (--height);
|
||||
} else if (pal == PALETTE_NEWSPAPER) {
|
||||
const uint8 *remap = GetNonSprite(pal, ST_RECOLOUR) + 1;
|
||||
const uint8 *remap = GetNonSprite(pal, SpriteType::Recolour) + 1;
|
||||
do {
|
||||
for (int i = 0; i != width; i++) {
|
||||
if (*anim == 0) *udst = MakeGrey(*udst);
|
||||
@@ -366,7 +366,7 @@ void Blitter_40bppAnim::DrawColourMappingRect(void *dst, int width, int height,
|
||||
anim = anim - width + _screen.pitch;
|
||||
} while (--height);
|
||||
} else {
|
||||
const uint8 *remap = GetNonSprite(pal, ST_RECOLOUR) + 1;
|
||||
const uint8 *remap = GetNonSprite(pal, SpriteType::Recolour) + 1;
|
||||
do {
|
||||
for (int i = 0; i != width; i++) {
|
||||
*anim = remap[*anim];
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
void Blitter_8bppBase::DrawColourMappingRect(void *dst, int width, int height, PaletteID pal)
|
||||
{
|
||||
const uint8 *ctab = GetNonSprite(pal, ST_RECOLOUR) + 1;
|
||||
const uint8 *ctab = GetNonSprite(pal, SpriteType::Recolour) + 1;
|
||||
|
||||
do {
|
||||
for (int i = 0; i != width; i++) *((uint8 *)dst + i) = ctab[((uint8 *)dst)[i]];
|
||||
|
@@ -127,7 +127,7 @@ Sprite *Blitter_8bppOptimized::Encode(const SpriteLoader::Sprite *sprite, Alloca
|
||||
ZoomLevel zoom_min;
|
||||
ZoomLevel zoom_max;
|
||||
|
||||
if (sprite->type == ST_FONT) {
|
||||
if (sprite->type == SpriteType::Font) {
|
||||
zoom_min = ZOOM_LVL_NORMAL;
|
||||
zoom_max = ZOOM_LVL_NORMAL;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user