From d97968a4f9dfedce1c416b513e7ee1973d707bca Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Wed, 28 Dec 2022 16:01:23 +0000 Subject: [PATCH] Rename ChildScreenSpritePositionMode enum values --- src/viewport.cpp | 10 +++++----- src/viewport_func.h | 2 +- src/viewport_type.h | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/viewport.cpp b/src/viewport.cpp index adabd705ad..f4bd8d9ed6 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -950,7 +950,7 @@ static void AddChildSpriteToFoundation(SpriteID image, PaletteID pal, const SubS int *old_child = _vd.last_child; _vd.last_child = _vd.last_foundation_child[foundation_part]; - AddChildSpriteScreen(image, pal, offs.x + extra_offs_x, offs.y + extra_offs_y, false, sub, false, ChildScreenSpritePositionMode::NON_RELATIVE); + AddChildSpriteScreen(image, pal, offs.x + extra_offs_x, offs.y + extra_offs_y, false, sub, false, ChildScreenSpritePositionMode::NonRelative); /* Switch back to last ChildSprite list */ _vd.last_child = old_child; @@ -1051,7 +1051,7 @@ static void AddCombinedSprite(SpriteID image, PaletteID pal, int x, int y, int z bottom <= _vdd->dpi.top) return; - AddChildSpriteScreen(image, pal, pt.x, pt.y, false, sub, false, ChildScreenSpritePositionMode::ABSOLUTE); + AddChildSpriteScreen(image, pal, pt.x, pt.y, false, sub, false, ChildScreenSpritePositionMode::Absolute); if (left < _vd.combine_left) _vd.combine_left = left; if (right > _vd.combine_right) _vd.combine_right = right; if (top < _vd.combine_top) _vd.combine_top = top; @@ -2052,15 +2052,15 @@ static void ViewportDrawParentSprites(const ViewportDrawerDynamic *vdd, const Dr int x = cs->x; int y = cs->y; switch (cs->position_mode) { - case ChildScreenSpritePositionMode::RELATIVE: + case ChildScreenSpritePositionMode::Relative: x += ps->left; y += ps->top; break; - case ChildScreenSpritePositionMode::NON_RELATIVE: + case ChildScreenSpritePositionMode::NonRelative: x += ps->x; y += ps->y; break; - case ChildScreenSpritePositionMode::ABSOLUTE: + case ChildScreenSpritePositionMode::Absolute: /* No adjustment */ break; } diff --git a/src/viewport_func.h b/src/viewport_func.h index 1f386b793d..1c665c4fc5 100644 --- a/src/viewport_func.h +++ b/src/viewport_func.h @@ -70,7 +70,7 @@ void OffsetGroundSprite(int x, int y); void DrawGroundSprite(SpriteID image, PaletteID pal, const SubSprite *sub = nullptr, int extra_offs_x = 0, int extra_offs_y = 0); void DrawGroundSpriteAt(SpriteID image, PaletteID pal, int32 x, int32 y, int z, const SubSprite *sub = nullptr, int extra_offs_x = 0, int extra_offs_y = 0); void AddSortableSpriteToDraw(SpriteID image, PaletteID pal, int x, int y, int w, int h, int dz, int z, bool transparent = false, int bb_offset_x = 0, int bb_offset_y = 0, int bb_offset_z = 0, const SubSprite *sub = nullptr); -void AddChildSpriteScreen(SpriteID image, PaletteID pal, int x, int y, bool transparent = false, const SubSprite *sub = nullptr, bool scale = true, ChildScreenSpritePositionMode position_mode = ChildScreenSpritePositionMode::RELATIVE); +void AddChildSpriteScreen(SpriteID image, PaletteID pal, int x, int y, bool transparent = false, const SubSprite *sub = nullptr, bool scale = true, ChildScreenSpritePositionMode position_mode = ChildScreenSpritePositionMode::Relative); void ViewportAddString(ViewportDrawerDynamic *vdd, const DrawPixelInfo *dpi, ZoomLevel small_from, const ViewportSign *sign, StringID string_normal, StringID string_small, StringID string_small_shadow, uint64 params_1, uint64 params_2 = 0, Colours colour = INVALID_COLOUR); diff --git a/src/viewport_type.h b/src/viewport_type.h index 3ec5981bdf..074e21155d 100644 --- a/src/viewport_type.h +++ b/src/viewport_type.h @@ -222,9 +222,9 @@ enum ViewportMarkDirtyFlags : byte { DECLARE_ENUM_AS_BIT_SET(ViewportMarkDirtyFlags) enum class ChildScreenSpritePositionMode : uint8 { - RELATIVE, - NON_RELATIVE, - ABSOLUTE, + Relative, + NonRelative, + Absolute, }; #endif /* VIEWPORT_TYPE_H */