1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 00:03:11 +01:00

Conditionally integrate pointer at 0xEE7880

This commit is contained in:
Michał Janiszewski
2016-08-30 14:27:08 +00:00
committed by Ted John
parent f2687eebb2
commit dd7bfdc529
4 changed files with 13 additions and 10 deletions

View File

@@ -760,7 +760,7 @@ void viewport_paint(rct_viewport* viewport, rct_drawpixelinfo* dpi, int left, in
}
gfx_clear(dpi2, colour);
}
RCT2_GLOBAL(0xEE7880, uint32) = 0xF1A4CC;
g_ps_EE7880 = (paint_struct *)0xF1A4CC;
unk_140E9A8 = dpi2;
painter_setup();
viewport_paint_setup();
@@ -1392,7 +1392,7 @@ void get_map_coordinates_from_pos(int screenX, int screenY, int flags, sint16 *x
dpi->zoom_level = RCT2_GLOBAL(RCT2_ADDRESS_VIEWPORT_ZOOM, uint16_t);
dpi->x = RCT2_GLOBAL(RCT2_ADDRESS_VIEWPORT_PAINT_X, int16_t);
dpi->width = 1;
RCT2_GLOBAL(0xEE7880, uint32_t) = 0xF1A4CC;
g_ps_EE7880 = (paint_struct *)0xF1A4CC;
unk_140E9A8 = dpi;
painter_setup();
viewport_paint_setup();

View File

@@ -36,6 +36,7 @@ paint_string_struct *pss2;
#ifdef NO_RCT2
paint_struct *g_paint_structs[512];
void *g_currently_drawn_item;
paint_struct * g_ps_EE7880;
#else
#define g_paint_structs (RCT2_ADDRESS(0x00F1A50C, paint_struct*))
#endif
@@ -82,7 +83,7 @@ static paint_struct * sub_9819_c(uint32 image_id, rct_xyz16 offset, rct_xyz16 bo
{
paint_struct * ps = unk_EE7888;
if ((uint32) ps >= RCT2_GLOBAL(0xEE7880, uint32))return NULL;
if (ps >= g_ps_EE7880) return NULL;
ps->image_id = image_id;
@@ -199,7 +200,7 @@ paint_struct * sub_98196C(
//Not a paint struct but something similar
paint_struct *ps = unk_EE7888;
if ((uint32) ps >= RCT2_GLOBAL(0xEE7880, uint32)) {
if (ps >= g_ps_EE7880) {
return NULL;
}
@@ -538,7 +539,7 @@ bool paint_attach_to_previous_attach(uint32 image_id, uint16 x, uint16 y)
attached_paint_struct * ps = (attached_paint_struct *)unk_EE7888;
if ((uint32) ps >= RCT2_GLOBAL(0xEE7880, uint32)) {
if ((paint_struct *)ps >= g_ps_EE7880) {
return false;
}
@@ -571,7 +572,7 @@ bool paint_attach_to_previous_ps(uint32 image_id, uint16 x, uint16 y)
{
attached_paint_struct * ps = (attached_paint_struct *)unk_EE7888;
if ((uint32) ps >= RCT2_GLOBAL(0xEE7880, uint32)) {
if ((paint_struct *)ps >= g_ps_EE7880) {
return false;
}
@@ -611,7 +612,7 @@ void sub_685EBC(money32 amount, rct_string_id string_id, sint16 y, sint16 z, sin
{
paint_string_struct * ps = (paint_string_struct *)unk_EE7888;
if ((uint32) ps >= RCT2_GLOBAL(0xEE7880, uint32)) {
if ((paint_struct *)ps >= g_ps_EE7880) {
return;
}

View File

@@ -23,11 +23,15 @@
#include "../drawing/drawing.h"
typedef struct attached_paint_struct attached_paint_struct;
struct paint_struct;
typedef struct paint_struct paint_struct;
#ifdef NO_RCT2
extern void *g_currently_drawn_item;
extern paint_struct * g_ps_EE7880;
#else
#define g_currently_drawn_item RCT2_GLOBAL(0x9DE578, void*)
#define g_ps_EE7880 RCT2_GLOBAL(0xEE7880, paint_struct *)
#endif
#pragma pack(push, 1)
@@ -50,8 +54,6 @@ struct attached_paint_struct {
assert_struct_size(attached_paint_struct, 0x12);
#endif
typedef struct paint_struct paint_struct;
/* size 0x34 */
struct paint_struct {
uint32 image_id; // 0x00

View File

@@ -2304,7 +2304,7 @@ static void sub_6CBCE2(
gCurrentViewportFlags = 0;
trackDirection &= 3;
RCT2_GLOBAL(0x00EE7880, uint32) = 0x00F1A4CC;
g_ps_EE7880 = (paint_struct *)0x00F1A4CC;
painter_setup();
ride = get_ride(rideIndex);