fix #1662, consistent location sign

This commit is contained in:
IntelOrca 2015-07-23 18:38:43 +01:00
parent 43b657730e
commit 1662b18a7e
9 changed files with 17 additions and 18 deletions

View File

@ -1379,7 +1379,7 @@ void window_rotate_camera(rct_window *w, int direction)
// other != viewport probably triggers on viewports in ride or guest window?
// x is 0x8000 if middle of viewport is obstructed by another window?
if (x == (sint16)SPRITE_LOCATION_NULL || other != viewport){
if (x == SPRITE_LOCATION_NULL || other != viewport) {
x = (viewport->view_width >> 1) + viewport->view_x;
y = (viewport->view_height >> 1) + viewport->view_y;

View File

@ -199,7 +199,7 @@ void news_item_get_subject_location(int type, int subject, int *x, int *y, int *
*x = peep->x;
*y = peep->y;
*z = peep->z;
if (*((uint16*)x) != SPRITE_LOCATION_NULL)
if (*x != SPRITE_LOCATION_NULL)
break;
if (peep->state != 3 && peep->state != 7) {

View File

@ -3913,9 +3913,9 @@ static void peep_update_walking_break_scenery(rct_peep* peep){
uint16 sprite_index;
FOR_ALL_STAFF(sprite_index, inner_peep){
if (inner_peep->staff_type != STAFF_TYPE_SECURITY)continue;
if (inner_peep->staff_type != STAFF_TYPE_SECURITY) continue;
if (inner_peep->x == (sint16)SPRITE_LOCATION_NULL)continue;
if (inner_peep->x == SPRITE_LOCATION_NULL) continue;
int x_diff = abs(inner_peep->x - peep->x);
int y_diff = abs(inner_peep->y - peep->y);

View File

@ -201,13 +201,13 @@ void game_command_hire_new_staff_member(int* eax, int* ebx, int* ecx, int* edx,
count = 0;
uint8 i;
for (i = 0; i < 4; ++i) {
if (RCT2_ADDRESS(RCT2_ADDRESS_PARK_ENTRANCE_X, uint16)[i] != SPRITE_LOCATION_NULL) ++count;
if (RCT2_ADDRESS(RCT2_ADDRESS_PARK_ENTRANCE_X, sint16)[i] != SPRITE_LOCATION_NULL) ++count;
}
if (count > 0) {
uint32 rand = scenario_rand_max(count);
for (i = 0; i < 4; ++i) {
if (RCT2_ADDRESS(RCT2_ADDRESS_PARK_ENTRANCE_X, uint16)[i] != SPRITE_LOCATION_NULL) {
if (RCT2_ADDRESS(RCT2_ADDRESS_PARK_ENTRANCE_X, sint16)[i] != SPRITE_LOCATION_NULL) {
if (rand == 0) break;
--rand;
}

View File

@ -445,9 +445,9 @@ void scenario_entrance_fee_too_high_check()
uint32 game_flags = RCT2_GLOBAL(RCT2_ADDRESS_PARK_FLAGS, uint32), packed_xy;
if ((game_flags & PARK_FLAGS_PARK_OPEN) && park_entrance_fee > max_fee) {
for (int i = 0; RCT2_ADDRESS(RCT2_ADDRESS_PARK_ENTRANCE_X, uint16)[i] != SPRITE_LOCATION_NULL; ++i) {
x = RCT2_ADDRESS(RCT2_ADDRESS_PARK_ENTRANCE_X, uint16)[i] + 16;
y = RCT2_ADDRESS(RCT2_ADDRESS_PARK_ENTRANCE_Y, uint16)[i] + 16;
for (int i = 0; RCT2_ADDRESS(RCT2_ADDRESS_PARK_ENTRANCE_X, sint16)[i] != SPRITE_LOCATION_NULL; i++) {
x = RCT2_ADDRESS(RCT2_ADDRESS_PARK_ENTRANCE_X, sint16)[i] + 16;
y = RCT2_ADDRESS(RCT2_ADDRESS_PARK_ENTRANCE_Y, sint16)[i] + 16;
}
packed_xy = (y << 16) | x;

View File

@ -196,7 +196,7 @@ static void window_game_bottom_toolbar_mouseup(rct_window *w, int widgetIndex)
news_item_get_subject_location(newsItem->type, subject, &x, &y, &z);
if ((uint16)x == SPRITE_LOCATION_NULL)
if (x == SPRITE_LOCATION_NULL)
break;
if ((mainWindow = window_get_main()) != NULL)

View File

@ -1060,10 +1060,10 @@ static void window_park_init_viewport(rct_window *w)
return;
for (i = 0; i < 4; i++) {
if (RCT2_ADDRESS(RCT2_ADDRESS_PARK_ENTRANCE_X, uint16)[i] != SPRITE_LOCATION_NULL) {
x = RCT2_ADDRESS(RCT2_ADDRESS_PARK_ENTRANCE_X, uint16)[i] + 16;
y = RCT2_ADDRESS(RCT2_ADDRESS_PARK_ENTRANCE_Y, uint16)[i] + 16;
z = RCT2_ADDRESS(RCT2_ADDRESS_PARK_ENTRANCE_Z, uint16)[i] + 32;
if (RCT2_ADDRESS(RCT2_ADDRESS_PARK_ENTRANCE_X, sint16)[i] != SPRITE_LOCATION_NULL) {
x = RCT2_ADDRESS(RCT2_ADDRESS_PARK_ENTRANCE_X, sint16)[i] + 16;
y = RCT2_ADDRESS(RCT2_ADDRESS_PARK_ENTRANCE_Y, sint16)[i] + 16;
z = RCT2_ADDRESS(RCT2_ADDRESS_PARK_ENTRANCE_Z, sint16)[i] + 32;
r = RCT2_GLOBAL(RCT2_ADDRESS_CURRENT_ROTATION, uint8);
xy = 0x40000000 | (y << 16) | x;

View File

@ -626,10 +626,9 @@ void reset_0x69EBE4(){
if (spr->unknown.sprite_identifier != 0xFF){
uint32 edi = spr->unknown.x;
if ((uint16)(spr->unknown.x) == SPRITE_LOCATION_NULL){
if (spr->unknown.x == SPRITE_LOCATION_NULL){
edi = 0x10000;
}
else{
} else {
int ecx = spr->unknown.y;
ecx >>= 5;
edi &= 0x1FE0;

View File

@ -26,7 +26,7 @@
#include "../ride/vehicle.h"
#define SPRITE_INDEX_NULL 0xFFFF
#define SPRITE_LOCATION_NULL 0x8000
#define SPRITE_LOCATION_NULL ((sint16)0x8000)
#define MAX_SPRITES 10000
enum SPRITE_IDENTIFIER{