1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-27 08:45:00 +01:00

Implement paint_68818E

This commit is contained in:
Marijn van der Werf
2016-04-29 12:55:23 +02:00
committed by duncanspumpkin
parent c84e0182e0
commit 0dcf6ce87a
3 changed files with 61 additions and 10 deletions

View File

@@ -1,4 +1,5 @@
#include "paint.h"
#include "../addresses.h"
/**
* rct2: 0x006881D0
@@ -14,23 +15,23 @@ bool paint_6881D0(uint32 image_id, uint16 x, uint16 y)
return paint_68818E(image_id, x, y, NULL);
}
paint_struct * ps = RCT2_GLOBAL(0xEE7888, paint_struct * );
attached_paint_struct * ps = RCT2_GLOBAL(0xEE7888, attached_paint_struct *);
if ((uint32) ps >= RCT2_GLOBAL(0xEE7880, uint32)) {
return false;
}
ps->image_id = image_id;
ps->attached_x = x;
ps->attached_y = y;
ps->var_0C = 0;
ps->x = x;
ps->y = y;
ps->flags = 0;
paint_struct * ebx = RCT2_GLOBAL(0xF1AD2C, paint_struct * );
attached_paint_struct * ebx = RCT2_GLOBAL(0xF1AD2C, attached_paint_struct *);
ps->next_attached_ps = NULL;
ebx->next_attached_ps = ps;
ps->next = NULL;
ebx->next = ps;
RCT2_GLOBAL(0xF1AD2C, paint_struct * ) = ps;
RCT2_GLOBAL(0xF1AD2C, attached_paint_struct *) = ps;
RCT2_GLOBAL(0xEE7888, uint32) += 0x12;
@@ -46,7 +47,37 @@ bool paint_6881D0(uint32 image_id, uint16 x, uint16 y)
* @param[out] paint (ebp)
* @return (!CF) success
*/
bool paint_68818E(uint32 image_id, uint16 x, uint16 y, paint_struct ** paint)
bool paint_68818E(uint32 image_id, uint16 x, uint16 y, attached_paint_struct ** paint)
{
//Not a paint struct but something similar
attached_paint_struct * ps = RCT2_GLOBAL(0xEE7888, attached_paint_struct *);
if ((uint32) ps >= RCT2_GLOBAL(0xEE7880, uint32)) {
return false;
}
ps->image_id = image_id;
ps->x = x;
ps->y = y;
ps->flags = 0;
attached_paint_struct * ebx2 = RCT2_GLOBAL(0xF1AD28, attached_paint_struct *);
if (ebx2 == NULL) {
return false;
}
RCT2_GLOBAL(0x00EE7888, uint32) += 0x12;
attached_paint_struct * edi = ebx2->next;
ebx2->next = ps;
ps->next = edi;
RCT2_GLOBAL(0xF1AD2C, attached_paint_struct *) = ps;
if (paint != NULL) {
*paint = ps;
}
return true;
}

View File

@@ -3,7 +3,23 @@
#include "../common.h"
typedef struct attached_paint_struct attached_paint_struct;
struct attached_paint_struct {
uint32 image_id; // 0x00
union {
uint32 tertiary_colour;
// If masked image_id is masked_id
uint32 colour_image_id;
};
uint16 x; // 0x08
uint16 y; // 0x0A
uint8 flags; // 0x0C
uint8 pad_0D;
attached_paint_struct* next; //0x0E
};
bool paint_6881D0(uint32 image_id, uint16 x, uint16 y);
bool paint_68818E(uint32 image_id, uint16 x, uint16 y, paint_struct ** paint);
bool paint_68818E(uint32 image_id, uint16 x, uint16 y, attached_paint_struct ** paint);
#endif

View File

@@ -32,6 +32,10 @@
#include "../world/footpath.h"
#include "../world/scenery.h"
#include "paint_surface.h"
#include "colour.h"
#include "paint.h"
#include "viewport.h"
#include "window.h"
//#define DEBUG_SHOW_DIRTY_BOX