Fix some warnings and do some optimizations

This commit is contained in:
Sijmen Schoon 2014-10-21 01:12:10 +02:00
parent a7b1e50a92
commit 3d53529abf
1 changed files with 4 additions and 3 deletions

View File

@ -496,14 +496,15 @@ void redraw_peep_and_rain()
gfx_set_dirty_blocks(left, top, right, bottom);
}
if (RCT2_GLOBAL(RCT2_ADDRESS_NO_RAIN_PIXELS, uint32) == 0) {
int rain_no_pixels = RCT2_GLOBAL(RCT2_ADDRESS_NO_RAIN_PIXELS, uint32);
if (rain_no_pixels == 0) {
return;
}
uint8 *screen_pixels = (int *)RCT2_ADDRESS(RCT2_ADDRESS_SCREEN_DPI, rct_drawpixelinfo)->bits;
uint32 *rain_pixels = RCT2_ADDRESS(RCT2_ADDRESS_RAIN_PIXEL_STORE, uint32);
int rain_no_pixels = RCT2_GLOBAL(RCT2_ADDRESS_NO_RAIN_PIXELS, uint32);
if (rain_pixels) {
uint8 *screen_pixels = RCT2_ADDRESS(RCT2_ADDRESS_SCREEN_DPI, rct_drawpixelinfo)->bits;
for (int i = 0; i < rain_no_pixels; i++) {
uint32 pixel = rain_pixels[i];
screen_pixels[pixel >> 8] = pixel & 0xFF;