1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-28 09:14:58 +01:00

Merge pull request #1 from duncanspumpkin/fix_rain

Fixed the buffer overflow. Increased the number of pixels again
This commit is contained in:
Matt Lagarenne
2014-12-05 09:57:57 -05:00

View File

@@ -31,7 +31,8 @@ int gLastDrawStringY;
uint8 _screenDirtyBlocks[5120];
uint32 rainPixels[0x4000];
#define MAX_RAIN_PIXELS 0x9000
uint32 rainPixels[MAX_RAIN_PIXELS];
//Originally 0x9ABE0C, 12 elements from 0xF3 are the peep top colour, 12 elements from 0xCA are peep trouser colour
const uint8 peep_palette[0x100] = {
@@ -447,7 +448,7 @@ void gfx_draw_rain(int left, int top, int width, int height, sint32 x_start, sin
uint8 pattern_x = pattern[pattern_y_pos * 2];
if (pattern_x != 0xFF){
if (RCT2_GLOBAL(RCT2_ADDRESS_NO_RAIN_PIXELS, uint32) <= 0x4000){
if (RCT2_GLOBAL(RCT2_ADDRESS_NO_RAIN_PIXELS, uint32) < (MAX_RAIN_PIXELS - (uint32)width)){
int final_pixel_offset = width + pixel_offset;