Fix guards for NO_RCT2 builds

This commit is contained in:
Michał Janiszewski 2016-09-17 23:54:42 +02:00 committed by Ted John
parent 20863bce52
commit 2d5de506f4
2 changed files with 13 additions and 5 deletions

View File

@ -50,7 +50,7 @@
int gExitCode;
#ifdef USE_MMAP
#if defined(__unix__) && !defined(NO_RCT2)
static int fdData;
static char * segments = (char *)(GOOD_PLACE_FOR_DATA_SEGMENT);
#endif
@ -354,7 +354,7 @@ void openrct2_dispose()
#ifndef DISABLE_NETWORK
EVP_MD_CTX_destroy(gHashCTX);
#endif // DISABLE_NETWORK
#if defined(USE_MMAP) && (defined(__unix__) || defined(__MACOSX__))
#if defined(USE_MMAP) && (defined(__unix__) || defined(__MACOSX__)) && !defined(NO_RCT2)
munmap(segments, 12079104);
close(fdData);
#endif
@ -506,7 +506,7 @@ bool openrct2_setup_rct2_segment()
// necessary. Windows does not need to do this as OpenRCT2 runs as a DLL loaded from the Windows PE.
int len = 0x01429000 - 0x8a4000; // 0xB85000, 12079104 bytes or around 11.5MB
int err = 0;
#if defined(USE_MMAP) && (defined(__unix__) || defined(__MACOSX__))
#if defined(USE_MMAP) && (defined(__unix__) || defined(__MACOSX__)) && !defined(NO_RCT2)
#define RDATA_OFFSET 0x004A4000
#define DATASEG_OFFSET 0x005E2000
@ -556,7 +556,7 @@ bool openrct2_setup_rct2_segment()
}
#endif // defined(USE_MMAP) && (defined(__unix__) || defined(__MACOSX__))
#if defined(__unix__)
#if defined(__unix__) && !defined(NO_RCT2)
int pageSize = getpagesize();
int numPages = (len + pageSize - 1) / pageSize;
unsigned char *dummy = malloc(numPages);
@ -632,7 +632,7 @@ bool openrct2_setup_rct2_segment()
SDL_RWclose(rw);
#endif // defined(USE_MMAP) && defined(__WINDOWS__)
#if !defined(NO_RCT2) || defined(USE_MMAP)
#if !defined(NO_RCT2) && defined(USE_MMAP)
// Check that the expected data is at various addresses.
// Start at 0x9a6000, which is start of .data, to skip the region containing addresses to DLL
// calls, which can be changed by windows/wine loader.

View File

@ -476,9 +476,13 @@ bool wooden_a_supports_paint_setup(int supportType, int special, int height, uin
*/
bool wooden_b_supports_paint_setup(int supportType, int special, int height, uint32 imageColourFlags)
{
#ifdef NO_RCT2
return 0;
#else
int eax = special, ebx = 0, ecx = 0, edx = height, esi = 0, _edi = supportType, ebp = imageColourFlags;
RCT2_CALLFUNC_X(0x00662D5C, &eax, &ebx, &ecx, &edx, &esi, &_edi, &ebp);
return eax & 0xFF;
#endif
}
/**
@ -673,9 +677,13 @@ bool metal_a_supports_paint_setup(int supportType, int segment, int special, int
*/
bool metal_b_supports_paint_setup(int supportType, uint8 segment, int special, int height, uint32 imageColourFlags)
{
#ifdef NO_RCT2
return 0;
#else
int eax = special, ebx = segment, ecx = 0, edx = height, esi = 0, _edi = supportType, ebp = imageColourFlags;
RCT2_CALLFUNC_X(0x00663584, &eax, &ebx, &ecx, &edx, &esi, &_edi, &ebp);
return eax & 0xFF;
#endif
}
/**