From b998f5b3d52dc329d984eead4d53277f7712bae6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sat, 10 Sep 2016 17:18:17 +0200 Subject: [PATCH 1/2] Integrate 0xF1AD0C --- src/paint/paint.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/paint/paint.c b/src/paint/paint.c index 38933cec83..eaba398525 100644 --- a/src/paint/paint.c +++ b/src/paint/paint.c @@ -32,6 +32,7 @@ paint_struct * g_ps_F1AD28; attached_paint_struct * g_aps_F1AD2C; paint_string_struct *pss1; paint_string_struct *pss2; +uint32 _F1AD0C; #ifdef NO_RCT2 static paint_struct *_paint_structs[512]; @@ -73,7 +74,7 @@ void painter_setup() { for (int i = 0; i < 512; i++) { _paint_structs[i] = NULL; } - RCT2_GLOBAL(0xF1AD0C, sint32) = -1; + _F1AD0C = -1; RCT2_GLOBAL(0xF1AD10, uint32) = 0; pss1 = NULL; pss2 = NULL; @@ -323,8 +324,8 @@ paint_struct * sub_98196C( _paint_structs[edi] = ps; ps->next_quadrant_ps = old_ps; - if ((uint16)edi < RCT2_GLOBAL(0x00F1AD0C, uint32)) { - RCT2_GLOBAL(0x00F1AD0C, uint32) = edi; + if ((uint16)edi < _F1AD0C) { + _F1AD0C = edi; } if ((uint16)edi > RCT2_GLOBAL(0x00F1AD10, uint32)) { @@ -407,8 +408,8 @@ paint_struct * sub_98197C( _paint_structs[di] = ps; ps->next_quadrant_ps = old_ps; - if ((uint16)di < RCT2_GLOBAL(0x00F1AD0C, uint32)) { - RCT2_GLOBAL(0x00F1AD0C, uint32) = di; + if ((uint16)di < _F1AD0C) { + _F1AD0C = di; } if ((uint16)di > RCT2_GLOBAL(0x00F1AD10, uint32)) { @@ -868,7 +869,7 @@ void sub_688217() unk_EE7888++; unk_EE7884 = ps; ps->next_quadrant_ps = NULL; - uint32 edi = RCT2_GLOBAL(0x00F1AD0C, uint32); + uint32 edi = _F1AD0C; if (edi == -1) return; @@ -883,11 +884,11 @@ void sub_688217() } } while (++edi <= RCT2_GLOBAL(0x00F1AD10, uint32)); - uint32 eax = RCT2_GLOBAL(0x00F1AD0C, uint32); + uint32 eax = _F1AD0C; sub_688217_helper(eax & 0xFFFF, 1 << 1); - eax = RCT2_GLOBAL(0x00F1AD0C, uint32); + eax = _F1AD0C; while (++eax < RCT2_GLOBAL(0x00F1AD10, uint32)) sub_688217_helper(eax & 0xFFFF, 0); From 40370aea34914e53b814a27dc4e5103890d92a0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sat, 10 Sep 2016 17:22:45 +0200 Subject: [PATCH 2/2] Conditionally integrate 0xF1AD10 --- src/paint/paint.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/paint/paint.c b/src/paint/paint.c index eaba398525..f7af917533 100644 --- a/src/paint/paint.c +++ b/src/paint/paint.c @@ -35,6 +35,7 @@ paint_string_struct *pss2; uint32 _F1AD0C; #ifdef NO_RCT2 +uint32 _F1AD10; static paint_struct *_paint_structs[512]; void *g_currently_drawn_item; paint_struct * g_ps_EE7880; @@ -43,6 +44,7 @@ support_height gSupportSegments[9] = { 0 }; support_height gSupport; #else #define _paint_structs (RCT2_ADDRESS(0x00F1A50C, paint_struct*)) +#define _F1AD10 RCT2_GLOBAL(0xF1AD10, uint32) #endif static const uint8 BoundBoxDebugColours[] = { @@ -75,7 +77,7 @@ void painter_setup() { _paint_structs[i] = NULL; } _F1AD0C = -1; - RCT2_GLOBAL(0xF1AD10, uint32) = 0; + _F1AD10 = 0; pss1 = NULL; pss2 = NULL; } @@ -328,8 +330,8 @@ paint_struct * sub_98196C( _F1AD0C = edi; } - if ((uint16)edi > RCT2_GLOBAL(0x00F1AD10, uint32)) { - RCT2_GLOBAL(0x00F1AD10, uint32) = edi; + if ((uint16)edi > _F1AD10) { + _F1AD10 = edi; } unk_EE7888 ++; @@ -412,8 +414,8 @@ paint_struct * sub_98197C( _F1AD0C = di; } - if ((uint16)di > RCT2_GLOBAL(0x00F1AD10, uint32)) { - RCT2_GLOBAL(0x00F1AD10, uint32) = di; + if ((uint16)di > _F1AD10) { + _F1AD10 = di; } unk_EE7888++; @@ -882,7 +884,7 @@ void sub_688217() ps_next = ps_next->next_quadrant_ps; } while (ps_next != NULL); } - } while (++edi <= RCT2_GLOBAL(0x00F1AD10, uint32)); + } while (++edi <= _F1AD10); uint32 eax = _F1AD0C; @@ -890,7 +892,7 @@ void sub_688217() eax = _F1AD0C; - while (++eax < RCT2_GLOBAL(0x00F1AD10, uint32)) + while (++eax < _F1AD10) sub_688217_helper(eax & 0xFFFF, 0); }