AGS: Move global_object globals to Globals

This commit is contained in:
Paul Gilbert 2021-03-08 20:03:22 -08:00
parent 81976cb994
commit 764271844a
4 changed files with 14 additions and 11 deletions

View File

@ -2098,8 +2098,6 @@ CharacterInfo *GetCharacterAtRoom(int x, int y) {
return &_GP(game).chars[hsnum];
}
extern int obj_lowest_yp;
int is_pos_on_character(int xx, int yy) {
int cc, sppic, lowestyp = 0, lowestwas = -1;
for (cc = 0; cc < _GP(game).numcharacters; cc++) {

View File

@ -115,8 +115,6 @@ extern int cur_mode, cur_cursor;
extern int _G(psp_gfx_renderer);
#endif
extern int obj_lowest_yp;
extern int actSpsCount;
extern Bitmap **actsps;
extern IDriverDependantBitmap * *actspsbmp;
@ -1662,9 +1660,9 @@ int __GetLocationType(int xxx, int yyy, int allowHotspot0) {
wbat = 0;
if ((charat >= 0) && (objat >= 0)) {
if ((wbat > obj_lowest_yp) && (wbat > _G(char_lowest_yp)))
if ((wbat > _G(obj_lowest_yp)) && (wbat > _G(char_lowest_yp)))
winner = LOCTYPE_HOTSPOT;
else if (obj_lowest_yp > _G(char_lowest_yp))
else if (_G(obj_lowest_yp) > _G(char_lowest_yp))
winner = LOCTYPE_OBJ;
else
winner = LOCTYPE_CHAR;
@ -1674,7 +1672,7 @@ int __GetLocationType(int xxx, int yyy, int allowHotspot0) {
else
winner = LOCTYPE_CHAR;
} else if (objat >= 0) {
if (wbat > obj_lowest_yp)
if (wbat > _G(obj_lowest_yp))
winner = LOCTYPE_HOTSPOT;
else
winner = LOCTYPE_OBJ;

View File

@ -57,9 +57,6 @@ extern Bitmap **actsps;
extern IDriverDependantBitmap **actspsbmp;
extern IGraphicsDriver *gfxDriver;
// Used for deciding whether a char or obj was closer
int obj_lowest_yp;
int GetObjectIDAtScreen(int scrx, int scry) {
// translate screen co-ordinates to room co-ordinates
VpPoint vpt = _GP(play).ScreenToRoomDivDown(scrx, scry);
@ -94,7 +91,7 @@ int GetObjectIDAtRoom(int roomx, int roomy) {
bestshotwas = aa;
bestshotyp = usebasel;
}
obj_lowest_yp = bestshotyp;
_G(obj_lowest_yp) = bestshotyp;
return bestshotwas;
}

View File

@ -526,6 +526,16 @@ public:
/**@}*/
/**
* \defgroup global_object globals
* @{
*/
// Used for deciding whether a char or obj was closer
int _obj_lowest_yp = 0;
/**@}*/
/**
* \defgroup graphics_mode globals
* @{