mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-23 14:54:30 +01:00
Use ImageId for picked up peep
This commit is contained in:
@@ -1173,7 +1173,7 @@ void WindowGuestOverviewToolUpdate(rct_window* w, rct_widgetindex widgetIndex, c
|
||||
map_invalidate_selection_rect();
|
||||
}
|
||||
|
||||
gPickupPeepImage = UINT32_MAX;
|
||||
gPickupPeepImage = ImageId();
|
||||
|
||||
auto info = get_map_coordinates_from_pos(screenCoords, ViewportInteractionItemAll);
|
||||
if (info.SpriteType == ViewportInteractionItem::None)
|
||||
@@ -1193,11 +1193,9 @@ void WindowGuestOverviewToolUpdate(rct_window* w, rct_widgetindex widgetIndex, c
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t imageId = GetPeepAnimation(peep->SpriteType, PeepActionSpriteType::Ui).base_image;
|
||||
imageId += w->picked_peep_frame >> 2;
|
||||
|
||||
imageId |= (peep->TshirtColour << 19) | (peep->TrousersColour << 24) | IMAGE_TYPE_REMAP | IMAGE_TYPE_REMAP_2_PLUS;
|
||||
gPickupPeepImage = imageId;
|
||||
auto baseImageId = GetPeepAnimation(peep->SpriteType, PeepActionSpriteType::Ui).base_image;
|
||||
baseImageId += w->picked_peep_frame >> 2;
|
||||
gPickupPeepImage = ImageId(baseImageId, peep->TshirtColour, peep->TrousersColour);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1222,7 +1220,7 @@ void WindowGuestOverviewToolDown(rct_window* w, rct_widgetindex widgetIndex, con
|
||||
if (result->Error != GameActions::Status::Ok)
|
||||
return;
|
||||
tool_cancel();
|
||||
gPickupPeepImage = UINT32_MAX;
|
||||
gPickupPeepImage = ImageId();
|
||||
});
|
||||
GameActions::Execute(&pickupAction);
|
||||
}
|
||||
|
||||
@@ -1171,7 +1171,7 @@ void WindowStaffOverviewToolUpdate(rct_window* w, rct_widgetindex widgetIndex, c
|
||||
map_invalidate_selection_rect();
|
||||
}
|
||||
|
||||
gPickupPeepImage = UINT32_MAX;
|
||||
gPickupPeepImage = ImageId();
|
||||
|
||||
auto info = get_map_coordinates_from_pos(screenCoords, ViewportInteractionItemAll);
|
||||
if (info.SpriteType == ViewportInteractionItem::None)
|
||||
@@ -1191,11 +1191,9 @@ void WindowStaffOverviewToolUpdate(rct_window* w, rct_widgetindex widgetIndex, c
|
||||
return;
|
||||
}
|
||||
|
||||
uint32_t imageId = GetPeepAnimation(peep->SpriteType, PeepActionSpriteType::Ui).base_image;
|
||||
imageId += w->picked_peep_frame >> 2;
|
||||
|
||||
imageId |= (peep->TshirtColour << 19) | (peep->TrousersColour << 24) | IMAGE_TYPE_REMAP | IMAGE_TYPE_REMAP_2_PLUS;
|
||||
gPickupPeepImage = imageId;
|
||||
auto baseImageId = GetPeepAnimation(peep->SpriteType, PeepActionSpriteType::Ui).base_image;
|
||||
baseImageId += w->picked_peep_frame >> 2;
|
||||
gPickupPeepImage = ImageId(baseImageId, peep->TshirtColour, peep->TrousersColour);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1219,7 +1217,7 @@ void WindowStaffOverviewToolDown(rct_window* w, rct_widgetindex widgetIndex, con
|
||||
if (result->Error != GameActions::Status::Ok)
|
||||
return;
|
||||
tool_cancel();
|
||||
gPickupPeepImage = UINT32_MAX;
|
||||
gPickupPeepImage = ImageId();
|
||||
});
|
||||
GameActions::Execute(&pickupAction);
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ void PaletteMap::Copy(size_t dstIndex, const PaletteMap& src, size_t srcIndex, s
|
||||
uint8_t gGamePalette[256 * 4];
|
||||
uint32_t gPaletteEffectFrame;
|
||||
|
||||
uint32_t gPickupPeepImage;
|
||||
ImageId gPickupPeepImage;
|
||||
int32_t gPickupPeepX;
|
||||
int32_t gPickupPeepY;
|
||||
|
||||
@@ -715,10 +715,10 @@ bool clip_drawpixelinfo(
|
||||
|
||||
void gfx_invalidate_pickedup_peep()
|
||||
{
|
||||
uint32_t sprite = gPickupPeepImage;
|
||||
if (sprite != UINT32_MAX)
|
||||
auto imageId = gPickupPeepImage;
|
||||
if (imageId.HasValue())
|
||||
{
|
||||
const rct_g1_element* g1 = gfx_get_g1_element(sprite & 0x7FFFF);
|
||||
auto* g1 = gfx_get_g1_element(imageId);
|
||||
if (g1 != nullptr)
|
||||
{
|
||||
int32_t left = gPickupPeepX + g1->x_offset;
|
||||
@@ -732,9 +732,9 @@ void gfx_invalidate_pickedup_peep()
|
||||
|
||||
void gfx_draw_pickedup_peep(rct_drawpixelinfo* dpi)
|
||||
{
|
||||
if (gPickupPeepImage != UINT32_MAX)
|
||||
if (gPickupPeepImage.HasValue())
|
||||
{
|
||||
gfx_draw_sprite(dpi, gPickupPeepImage, { gPickupPeepX, gPickupPeepY }, 0);
|
||||
gfx_draw_sprite(dpi, gPickupPeepImage, { gPickupPeepX, gPickupPeepY });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -482,7 +482,7 @@ extern thread_local uint8_t gOtherPalette[256];
|
||||
extern uint8_t text_palette[];
|
||||
extern const translucent_window_palette TranslucentWindowPalettes[COLOUR_COUNT];
|
||||
|
||||
extern uint32_t gPickupPeepImage;
|
||||
extern ImageId gPickupPeepImage;
|
||||
extern int32_t gPickupPeepX;
|
||||
extern int32_t gPickupPeepY;
|
||||
|
||||
|
||||
@@ -569,7 +569,7 @@ void Peep::PickupAbort(int32_t old_x)
|
||||
PathCheckOptimisation = 0;
|
||||
}
|
||||
|
||||
gPickupPeepImage = UINT32_MAX;
|
||||
gPickupPeepImage = ImageId();
|
||||
}
|
||||
|
||||
// Returns GameActions::Status::OK when a peep can be dropped at the given location. When apply is set to true the peep gets
|
||||
|
||||
@@ -86,7 +86,7 @@ void viewport_init_all()
|
||||
input_reset_flags();
|
||||
input_set_state(InputState::Reset);
|
||||
gPressedWidget.window_classification = 255;
|
||||
gPickupPeepImage = UINT32_MAX;
|
||||
gPickupPeepImage = ImageId();
|
||||
reset_tooltip_not_shown();
|
||||
gMapSelectFlags = 0;
|
||||
gStaffDrawPatrolAreas = 0xFFFF;
|
||||
|
||||
Reference in New Issue
Block a user