1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-28 18:22:56 +01:00

Fix pointer types for 64 bit builds

This commit is contained in:
Michał Janiszewski
2016-07-30 14:13:04 +02:00
parent ddb72b6f22
commit b16b6814aa
5 changed files with 14 additions and 15 deletions

View File

@@ -144,7 +144,7 @@ void load_palette(){
uint32 palette = 0x5FC;
if ((sint32)water_type != -1){
if ((intptr_t)water_type != -1){
palette = water_type->image_id;
}

View File

@@ -142,7 +142,7 @@ void update_palette_effects()
// change palette to lighter colour during lightning
int palette = 1532;
if ((sint32)water_type != -1) {
if ((intptr_t)water_type != -1) {
palette = water_type->image_id;
}
rct_g1_element g1_element = g1Elements[palette];
@@ -161,7 +161,7 @@ void update_palette_effects()
// change palette back to normal after lightning
int palette = 1532;
if ((sint32)water_type != -1) {
if ((intptr_t)water_type != -1) {
palette = water_type->image_id;
}
@@ -188,7 +188,7 @@ void update_palette_effects()
uint32 j = gPaletteEffectFrame;
j = (((uint16)((~j / 2) * 128) * 15) >> 16);
int p = 1533;
if ((sint32)water_type != -1) {
if ((intptr_t)water_type != -1) {
p = water_type->var_06;
}
rct_g1_element g1_element = g1Elements[q + p];
@@ -207,7 +207,7 @@ void update_palette_effects()
}
p = 1536;
if ((sint32)water_type != -1) {
if ((intptr_t)water_type != -1) {
p = water_type->var_0A;
}
g1_element = g1Elements[q + p];

View File

@@ -1062,7 +1062,7 @@ void process_mouse_over(int x, int y)
int widgetId;
int cursorId;
int ebx, esi, edi, ebp;
int ebx, edi;
cursorId = CURSOR_ARROW;
set_map_tooltip_format_arg(0, rct_string_id, STR_NONE);
@@ -1087,13 +1087,11 @@ void process_mouse_over(int x, int y)
gCurrentToolWidget.window_classification,
gCurrentToolWidget.window_number
);
ebp = (int)subWindow;
if (subWindow == NULL)
break;
ebx = 0;
edi = cursorId;
esi = (int)subWindow;
// Window event WE_UNKNOWN_0E was called here, but no windows actually implemented a handler and
// its not known what it was for
cursorId = edi;

View File

@@ -1244,7 +1244,8 @@ static bool sub_679074(rct_drawpixelinfo *dpi, int imageId, sint16 x, sint16 y)
uint8 *source_pointer = image->offset;
uint8 *new_source_pointer_start = malloc(total_no_pixels);
uint8 *new_source_pointer = (*&new_source_pointer_start);// 0x9E3D28;
int ebx1, ecx;
intptr_t ebx1;
int ecx;
while (total_no_pixels > 0) {
sint8 no_pixels = *source_pointer;
if (no_pixels >= 0) {
@@ -1263,8 +1264,8 @@ static bool sub_679074(rct_drawpixelinfo *dpi, int imageId, sint16 x, sint16 y)
eax = (eax & 0xFF00) + *(source_pointer + 1);
total_no_pixels -= ecx;
source_pointer += 2;
ebx1 = (uint32) new_source_pointer - eax;
eax = (uint32) source_pointer;
ebx1 = (uintptr_t) new_source_pointer - eax;
eax = (uintptr_t) source_pointer;
source_pointer = (uint8 *) ebx1;
ebx1 = eax;
eax = 0;
@@ -1273,7 +1274,7 @@ static bool sub_679074(rct_drawpixelinfo *dpi, int imageId, sint16 x, sint16 y)
source_pointer = (uint8 *) ebx1;
}
bool output = sub_679236_679662_679B0D_679FF1(ebx, image, new_source_pointer_start + (uint32) offset);
bool output = sub_679236_679662_679B0D_679FF1(ebx, image, new_source_pointer_start + (uintptr_t) offset);
free(new_source_pointer_start);
return output;

View File

@@ -218,7 +218,7 @@ void scenario_begin()
}
} else {
rct_stex_entry* stex = g_stexEntries[0];
if ((int)stex != -1) {
if ((intptr_t)stex != -1) {
char *buffer = (char*)RCT2_ADDRESS_COMMON_STRING_FORMAT_BUFFER;
// Set localised park name
@@ -453,7 +453,7 @@ static void scenario_week_update()
rct_water_type* water_type = (rct_water_type*)object_entry_groups[OBJECT_TYPE_WATER].chunks[0];
if (month <= MONTH_APRIL && (sint32)water_type != -1 && water_type->var_0E & 1) {
if (month <= MONTH_APRIL && (intptr_t)water_type != -1 && water_type->var_0E & 1) {
// 100 attempts at finding some water to create a few ducks at
for (int i = 0; i < 100; i++) {
if (scenario_create_ducks())
@@ -666,7 +666,7 @@ int scenario_prepare_for_save()
s6Info->entry.flags = 255;
rct_stex_entry* stex = g_stexEntries[0];
if ((int)stex != 0xFFFFFFFF) {
if ((intptr_t)stex != -1) {
format_string(buffer, stex->scenario_name, NULL);
safe_strcpy(s6Info->name, buffer, sizeof(s6Info->name));