mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-09 03:10:22 +00:00
AGS: Move global_object globals to Globals
This commit is contained in:
parent
81976cb994
commit
764271844a
@ -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++) {
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
* @{
|
||||
|
Loading…
Reference in New Issue
Block a user