From 4f77ba0698f44af3e7c47181b070f5ecd16c8af0 Mon Sep 17 00:00:00 2001 From: Duncan Date: Mon, 16 Jun 2014 16:09:29 +0100 Subject: [PATCH] Added extra zoom code This is some sort of short cut code. I think some of the more common sprites are precomputed for zoomed images. --- src/gfx.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/gfx.c b/src/gfx.c index 3c568c6f6b..72a1a0e6b4 100644 --- a/src/gfx.c +++ b/src/gfx.c @@ -1003,7 +1003,24 @@ void gfx_draw_sprite_palette_set(rct_drawpixelinfo *dpi, int image_id, int x, in int image_type = (image_id & 0xE0000000) >> 28; rct_g1_element* g1_source = &(RCT2_ADDRESS(RCT2_ADDRESS_G1_ELEMENTS, rct_g1_element)[image_element]); + + if ( dpi->zoom_level && !(g1_source->flags & (1<<4)) ){ + rct_drawpixelinfo zoomed_dpi = { + .bits = dpi->bits, + .x = dpi->x >> 1, + .y = dpi->y >> 1, + .height = dpi->height>>1, + .width = dpi->width>>1, + .pitch = dpi->pitch, + .zoom_level = dpi->zoomlevel - 1 + }; + gfx_draw_sprite_palette_set(&zoomed_dpi,(image_type << 28) | (image_element - dpi->zoom_level), x >> 1, y >> 1, palette_pointer, unknown_pointer); + return; + } + if ( dpi->zoom_level && !(g1_source->flags & (1<<5)) ){ + return; + } //Zooming code has been integrated into main code. /*if (dpi->zoom_level >= 1){ //These have not been tested //something to do with zooming