1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-06 06:32:56 +01:00

fixes #293, closes #301 (min/max) and fixes #304 (research window bug)

This commit is contained in:
IntelOrca
2014-08-16 18:15:27 +01:00
parent e3c407d5b5
commit 9b64c576c4
2 changed files with 8 additions and 2 deletions

View File

@@ -42,6 +42,12 @@ typedef unsigned long long uint64;
#define ror32(x, shift) (((uint32)(x) >> (shift)) | ((uint32)(x) << (32 - (shift))))
#define rol64(x, shift) (((uint64)(x) << (shift)) | ((uint32)(x) >> (64 - (shift))))
#define ror64(x, shift) (((uint64)(x) >> (shift)) | ((uint32)(x) << (64 - (shift))))
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#define sgn(x) ((x > 0) ? 1 : ((x < 0) ? -1 : 0))
#define clamp(l, x, h) (min(h, max(l, x)))

View File

@@ -342,7 +342,7 @@ static void window_research_development_paint()
if (RCT2_GLOBAL(0x01357CF3, uint8) != 1) {
uint32 typeId = RCT2_GLOBAL(0x013580E0, uint32);
if (typeId >= 0x10000) {
uint8 *rideEntry = RCT2_GLOBAL(0x009ACFA4 + (typeId & 0xFFFF) * 4, uint8*);
uint8 *rideEntry = RCT2_GLOBAL(0x009ACFA4 + (typeId & 0xFF) * 4, uint8*);
if (RCT2_GLOBAL(rideEntry + 8, uint32) & 0x1000)
stringId = RCT2_GLOBAL(rideEntry, uint16);
else
@@ -380,7 +380,7 @@ static void window_research_development_paint()
uint32 typeId = RCT2_GLOBAL(0x01357CF4, uint32);
if (typeId != 0xFFFFFFFF) {
if (typeId >= 0x10000) {
uint8 *rideEntry = RCT2_GLOBAL(0x009ACFA4 + (typeId & 0xFFFF) * 4, uint8*);
uint8 *rideEntry = RCT2_GLOBAL(0x009ACFA4 + (typeId & 0xFF) * 4, uint8*);
if (RCT2_GLOBAL(rideEntry + 8, uint32) & 0x1000)
stringId = RCT2_GLOBAL(rideEntry, uint16);
else