mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-22 22:34:33 +01:00
Merge pull request #10708 from ZehMatt/refactor/drawing-unused-param
Remove unused parameter and minor cleanup
This commit is contained in:
@@ -311,8 +311,7 @@ rct_drawpixelinfo TextureCache::GetGlyphAsDPI(uint32_t image, uint8_t* palette)
|
||||
int32_t height = g1Element->height;
|
||||
|
||||
rct_drawpixelinfo dpi = CreateDPI(width, height);
|
||||
gfx_draw_sprite_palette_set_software(
|
||||
&dpi, ImageId::FromUInt32(image), -g1Element->x_offset, -g1Element->y_offset, palette, nullptr);
|
||||
gfx_draw_sprite_palette_set_software(&dpi, ImageId::FromUInt32(image), -g1Element->x_offset, -g1Element->y_offset, palette);
|
||||
return dpi;
|
||||
}
|
||||
|
||||
|
||||
@@ -508,7 +508,7 @@ void FASTCALL gfx_bmp_sprite_to_buffer(
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t* FASTCALL gfx_draw_sprite_get_palette(ImageId imageId)
|
||||
const uint8_t* FASTCALL gfx_draw_sprite_get_palette(ImageId imageId)
|
||||
{
|
||||
if (!imageId.HasSecondary())
|
||||
{
|
||||
@@ -569,7 +569,7 @@ void FASTCALL gfx_draw_sprite_software(rct_drawpixelinfo* dpi, ImageId imageId,
|
||||
if (imageId.HasValue())
|
||||
{
|
||||
auto palette = gfx_draw_sprite_get_palette(imageId);
|
||||
gfx_draw_sprite_palette_set_software(dpi, imageId, x, y, palette, nullptr);
|
||||
gfx_draw_sprite_palette_set_software(dpi, imageId, x, y, palette);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -583,7 +583,7 @@ void FASTCALL gfx_draw_sprite_software(rct_drawpixelinfo* dpi, ImageId imageId,
|
||||
* y (dx)
|
||||
*/
|
||||
void FASTCALL gfx_draw_sprite_palette_set_software(
|
||||
rct_drawpixelinfo* dpi, ImageId imageId, int32_t x, int32_t y, uint8_t* palette_pointer, uint8_t* unknown_pointer)
|
||||
rct_drawpixelinfo* dpi, ImageId imageId, int32_t x, int32_t y, const uint8_t* palette_pointer)
|
||||
{
|
||||
const auto* g1 = gfx_get_g1_element(imageId);
|
||||
if (g1 == nullptr)
|
||||
@@ -602,8 +602,7 @@ void FASTCALL gfx_draw_sprite_palette_set_software(
|
||||
zoomed_dpi.pitch = dpi->pitch;
|
||||
zoomed_dpi.zoom_level = dpi->zoom_level - 1;
|
||||
gfx_draw_sprite_palette_set_software(
|
||||
&zoomed_dpi, imageId.WithIndex(imageId.GetIndex() - g1->zoomed_offset), x >> 1, y >> 1, palette_pointer,
|
||||
unknown_pointer);
|
||||
&zoomed_dpi, imageId.WithIndex(imageId.GetIndex() - g1->zoomed_offset), x >> 1, y >> 1, palette_pointer);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -501,9 +501,9 @@ void FASTCALL gfx_draw_sprite_raw_masked(rct_drawpixelinfo* dpi, int32_t x, int3
|
||||
void FASTCALL gfx_draw_sprite_solid(rct_drawpixelinfo* dpi, int32_t image, int32_t x, int32_t y, uint8_t colour);
|
||||
|
||||
void FASTCALL gfx_draw_sprite_software(rct_drawpixelinfo* dpi, ImageId imageId, int32_t x, int32_t y);
|
||||
uint8_t* FASTCALL gfx_draw_sprite_get_palette(ImageId imageId);
|
||||
const uint8_t* FASTCALL gfx_draw_sprite_get_palette(ImageId imageId);
|
||||
void FASTCALL gfx_draw_sprite_palette_set_software(
|
||||
rct_drawpixelinfo* dpi, ImageId imageId, int32_t x, int32_t y, uint8_t* palette_pointer, uint8_t* unknown_pointer);
|
||||
rct_drawpixelinfo* dpi, ImageId imageId, int32_t x, int32_t y, const uint8_t* palette_pointer);
|
||||
void FASTCALL
|
||||
gfx_draw_sprite_raw_masked_software(rct_drawpixelinfo* dpi, int32_t x, int32_t y, int32_t maskImage, int32_t colourImage);
|
||||
|
||||
|
||||
@@ -712,7 +712,7 @@ void X8DrawingContext::FilterRect(FILTER_PALETTE_ID palette, int32_t left, int32
|
||||
const int32_t step = ((dpi->width >> dpi->zoom_level) + dpi->pitch);
|
||||
|
||||
// Fill the rectangle with the colours from the colour table
|
||||
for (int32_t i = 0; i<height>> dpi->zoom_level; i++)
|
||||
for (int32_t i = 0; i < (height >> dpi->zoom_level); i++)
|
||||
{
|
||||
uint8_t* nextdst = dst + step * i;
|
||||
for (int32_t j = 0; j < scaled_width; j++)
|
||||
@@ -743,13 +743,12 @@ void X8DrawingContext::DrawSpriteSolid(uint32_t image, int32_t x, int32_t y, uin
|
||||
uint8_t palette[256];
|
||||
std::fill_n(palette, sizeof(palette), colour);
|
||||
palette[0] = 0;
|
||||
gfx_draw_sprite_palette_set_software(
|
||||
_dpi, ImageId::FromUInt32((image & 0x7FFFF) | IMAGE_TYPE_REMAP), x, y, palette, nullptr);
|
||||
gfx_draw_sprite_palette_set_software(_dpi, ImageId::FromUInt32((image & 0x7FFFF) | IMAGE_TYPE_REMAP), x, y, palette);
|
||||
}
|
||||
|
||||
void X8DrawingContext::DrawGlyph(uint32_t image, int32_t x, int32_t y, uint8_t* palette)
|
||||
{
|
||||
gfx_draw_sprite_palette_set_software(_dpi, ImageId::FromUInt32(image), x, y, palette, nullptr);
|
||||
gfx_draw_sprite_palette_set_software(_dpi, ImageId::FromUInt32(image), x, y, palette);
|
||||
}
|
||||
|
||||
void X8DrawingContext::SetDPI(rct_drawpixelinfo* dpi)
|
||||
|
||||
Reference in New Issue
Block a user