AGS: Remove _G macros from comments

This commit is contained in:
Paul Gilbert 2021-06-07 19:20:34 -07:00
parent eb1e337edd
commit 73347d4559
14 changed files with 27 additions and 30 deletions

View File

@ -2069,7 +2069,7 @@ void CheckViewFrameForCharacter(CharacterInfo *chi) {
Bitmap *GetCharacterImage(int charid, int *isFlipped) { Bitmap *GetCharacterImage(int charid, int *isFlipped) {
if (!_G(gfxDriver)->HasAcceleratedTransform()) { if (!_G(gfxDriver)->HasAcceleratedTransform()) {
if (_G(actsps)[charid + MAX_ROOM_OBJECTS] != nullptr) { if (_G(actsps)[charid + MAX_ROOM_OBJECTS] != nullptr) {
// the _G(actsps) image is pre-flipped, so no longer register the image as such // the actsps image is pre-flipped, so no longer register the image as such
if (isFlipped) if (isFlipped)
*isFlipped = 0; *isFlipped = 0;
return _G(actsps)[charid + MAX_ROOM_OBJECTS]; return _G(actsps)[charid + MAX_ROOM_OBJECTS];

View File

@ -116,7 +116,7 @@ int _display_main(int xx, int yy, int wii, const char *text, int disp_type, int
} }
if (asspch > 0) { if (asspch > 0) {
// update the _G(all_buttons_disabled) variable in advance // update the all_buttons_disabled variable in advance
// of the adjust_x/y_for_guis calls // of the adjust_x/y_for_guis calls
_GP(play).disabled_user_interface++; _GP(play).disabled_user_interface++;
update_gui_disabled_status(); update_gui_disabled_status();

View File

@ -151,7 +151,7 @@ Bitmap *convert_32_to_32bgr(Bitmap *tempbl) {
// could copy them to texture without additional changes. // could copy them to texture without additional changes.
// AGS own OpenGL renderer tries to sync its behavior with the former one. // AGS own OpenGL renderer tries to sync its behavior with the former one.
// //
// TODO: make _G(gfxDriver)->GetCompatibleBitmapFormat describe all necessary // TODO: make gfxDriver->GetCompatibleBitmapFormat describe all necessary
// conversions, so that we did not have to guess. // conversions, so that we did not have to guess.
// //
Bitmap *AdjustBitmapForUseWithDisplayMode(Bitmap *bitmap, bool has_alpha) { Bitmap *AdjustBitmapForUseWithDisplayMode(Bitmap *bitmap, bool has_alpha) {
@ -1067,7 +1067,7 @@ void get_local_tint(int xpp, int ypp, int nolight,
// Applies the specified RGB Tint or Light Level to the _G(actsps) // Applies the specified RGB Tint or Light Level to the actsps
// sprite indexed with actspsindex // sprite indexed with actspsindex
void apply_tint_or_light(int actspsindex, int light_level, void apply_tint_or_light(int actspsindex, int light_level,
int tint_amount, int tint_red, int tint_green, int tint_amount, int tint_red, int tint_green,
@ -1133,9 +1133,9 @@ void apply_tint_or_light(int actspsindex, int light_level,
} }
// Draws the specified 'sppic' sprite onto _G(actsps)[useindx] at the // Draws the specified 'sppic' sprite onto actsps[useindx] at the
// specified width and height, and flips the sprite if necessary. // specified width and height, and flips the sprite if necessary.
// Returns 1 if something was drawn to _G(actsps); returns 0 if no // Returns 1 if something was drawn to actsps; returns 0 if no
// scaling or stretching was required, in which case nothing was done // scaling or stretching was required, in which case nothing was done
int scale_and_flip_sprite(int useindx, int coldept, int zoom_level, int scale_and_flip_sprite(int useindx, int coldept, int zoom_level,
int sppic, int newwidth, int newheight, int sppic, int newwidth, int newheight,
@ -1152,7 +1152,7 @@ int scale_and_flip_sprite(int useindx, int coldept, int zoom_level,
_G(our_eip) = 334; _G(our_eip) = 334;
// Ensure that anti-aliasing routines have a _G(palette) to // Ensure that anti-aliasing routines have a palette to
// use for mapping while faded out // use for mapping while faded out
if (_G(in_new_room)) if (_G(in_new_room))
select_palette(_G(palette)); select_palette(_G(palette));
@ -1213,8 +1213,8 @@ int scale_and_flip_sprite(int useindx, int coldept, int zoom_level,
// create the _G(actsps)[aa] image with the object drawn correctly // create the actsps[aa] image with the object drawn correctly
// returns 1 if nothing at all has changed and _G(actsps) is still // returns 1 if nothing at all has changed and actsps is still
// intact from last time; 0 otherwise // intact from last time; 0 otherwise
int construct_object_gfx(int aa, int *drawnWidth, int *drawnHeight, bool alwaysUseSoftware) { int construct_object_gfx(int aa, int *drawnWidth, int *drawnHeight, bool alwaysUseSoftware) {
int useindx = aa; int useindx = aa;
@ -1348,7 +1348,7 @@ int construct_object_gfx(int aa, int *drawnWidth, int *drawnHeight, bool alwaysU
actspsUsed = scale_and_flip_sprite(useindx, coldept, zoom_level, actspsUsed = scale_and_flip_sprite(useindx, coldept, zoom_level,
_G(objs)[aa].num, sprwidth, sprheight, isMirrored); _G(objs)[aa].num, sprwidth, sprheight, isMirrored);
} else { } else {
// ensure _G(actsps) exists // ensure actsps exists
_G(actsps)[useindx] = recycle_bitmap(_G(actsps)[useindx], coldept, _GP(game).SpriteInfos[_G(objs)[aa].num].Width, _GP(game).SpriteInfos[_G(objs)[aa].num].Height); _G(actsps)[useindx] = recycle_bitmap(_G(actsps)[useindx], coldept, _GP(game).SpriteInfos[_G(objs)[aa].num].Width, _GP(game).SpriteInfos[_G(objs)[aa].num].Height);
} }
@ -1603,7 +1603,7 @@ void prepare_characters_for_drawing() {
(_G(gfxDriver)->HasAcceleratedTransform())) { (_G(gfxDriver)->HasAcceleratedTransform())) {
usingCachedImage = true; usingCachedImage = true;
} else if (_G(charcache)[aa].inUse) { } else if (_G(charcache)[aa].inUse) {
//destroy_bitmap (_G(charcache)[aa].image); //destroy_bitmap (charcache[aa].image);
_G(charcache)[aa].inUse = 0; _G(charcache)[aa].inUse = 0;
} }
@ -1644,7 +1644,7 @@ void prepare_characters_for_drawing() {
// If cache needs to be re-drawn // If cache needs to be re-drawn
if (!_G(charcache)[aa].inUse) { if (!_G(charcache)[aa].inUse) {
// create the base sprite in _G(actsps)[useindx], which will // create the base sprite in actsps[useindx], which will
// be scaled and/or flipped, as appropriate // be scaled and/or flipped, as appropriate
int actspsUsed = 0; int actspsUsed = 0;
if (!_G(gfxDriver)->HasAcceleratedTransform()) { if (!_G(gfxDriver)->HasAcceleratedTransform()) {
@ -1652,7 +1652,7 @@ void prepare_characters_for_drawing() {
useindx, coldept, zoom_level, sppic, useindx, coldept, zoom_level, sppic,
newwidth, newheight, isMirrored); newwidth, newheight, isMirrored);
} else { } else {
// ensure _G(actsps) exists // ensure actsps exists
_G(actsps)[useindx] = recycle_bitmap(_G(actsps)[useindx], coldept, _GP(game).SpriteInfos[sppic].Width, _GP(game).SpriteInfos[sppic].Height); _G(actsps)[useindx] = recycle_bitmap(_G(actsps)[useindx], coldept, _GP(game).SpriteInfos[sppic].Width, _GP(game).SpriteInfos[sppic].Height);
} }
@ -2239,7 +2239,7 @@ void render_graphics(IDriverDependantBitmap *extraBitmap, int extraX, int extraY
render_to_screen(); render_to_screen();
if (!SHOULD_QUIT && !_GP(play).screen_is_faded_out) { if (!SHOULD_QUIT && !_GP(play).screen_is_faded_out) {
// always update the _G(palette), regardless of whether the plugin // always update the palette, regardless of whether the plugin
// vetos the screen update // vetos the screen update
if (_G(bg_just_changed)) { if (_G(bg_just_changed)) {
setpal(); setpal();

View File

@ -133,8 +133,8 @@ void draw_game_screen_callback();
void GfxDriverOnInitCallback(void *data); void GfxDriverOnInitCallback(void *data);
bool GfxDriverNullSpriteCallback(int x, int y); bool GfxDriverNullSpriteCallback(int x, int y);
void putpixel_compensate(Shared::Bitmap *g, int xx, int yy, int col); void putpixel_compensate(Shared::Bitmap *g, int xx, int yy, int col);
// create the _G(actsps)[aa] image with the object drawn correctly // create the actsps[aa] image with the object drawn correctly
// returns 1 if nothing at all has changed and _G(actsps) is still // returns 1 if nothing at all has changed and actsps is still
// intact from last time; 0 otherwise // intact from last time; 0 otherwise
int construct_object_gfx(int aa, int *drawnWidth, int *drawnHeight, bool alwaysUseSoftware); int construct_object_gfx(int aa, int *drawnWidth, int *drawnHeight, bool alwaysUseSoftware);
void clear_letterbox_borders(); void clear_letterbox_borders();

View File

@ -52,7 +52,7 @@ int run_claimable_event(const char *tsname, bool includeRoom, int numParams, con
*eventWasClaimed = true; *eventWasClaimed = true;
// Run the room script function, and if it is not claimed, // Run the room script function, and if it is not claimed,
// then run the main one // then run the main one
// We need to remember the _G(eventClaimed) variable's state, in case // We need to remember the eventClaimed variable's state, in case
// this is a nested event // this is a nested event
int eventClaimedOldValue = _G(eventClaimed); int eventClaimedOldValue = _G(eventClaimed);
_G(eventClaimed) = EVENT_INPROGRESS; _G(eventClaimed) = EVENT_INPROGRESS;

View File

@ -1439,7 +1439,7 @@ void game_sprite_deleted(int sprnum) {
_GP(guibuts)[i].NotifyParentChanged(); _GP(guibuts)[i].NotifyParentChanged();
} }
} }
// _G(views) // views
for (size_t v = 0; v < (size_t)_GP(game).numviews; ++v) { for (size_t v = 0; v < (size_t)_GP(game).numviews; ++v) {
for (size_t l = 0; l < (size_t)_G(views)[v].numLoops; ++l) { for (size_t l = 0; l < (size_t)_G(views)[v].numLoops; ++l) {
for (size_t f = 0; f < (size_t)_G(views)[v].loops[l].numFrames; ++f) { for (size_t f = 0; f < (size_t)_G(views)[v].loops[l].numFrames; ++f) {

View File

@ -546,7 +546,7 @@ RuntimeScriptValue Sc_GetInvGraphic(const RuntimeScriptValue *params, int32_t pa
API_SCALL_INT_PINT(GetInvGraphic); API_SCALL_INT_PINT(GetInvGraphic);
} }
// void (int indx,char*_G(buff)) // void (int indx,char*buff)
RuntimeScriptValue Sc_GetInvName(const RuntimeScriptValue *params, int32_t param_count) { RuntimeScriptValue Sc_GetInvName(const RuntimeScriptValue *params, int32_t param_count) {
API_SCALL_VOID_PINT_POBJ(GetInvName, char); API_SCALL_VOID_PINT_POBJ(GetInvName, char);
} }

View File

@ -59,7 +59,7 @@ void DisplaySimple(const char *text) {
} }
void DisplayTopBar(int ypos, int ttexcol, int backcol, const char *title, const char *text) { void DisplayTopBar(int ypos, int ttexcol, int backcol, const char *title, const char *text) {
// FIXME: refactor _G(source_text_length) and get rid of this ugly hack! // FIXME: refactor source_text_length and get rid of this ugly hack!
const int real_text_sourcelen = _G(source_text_length); const int real_text_sourcelen = _G(source_text_length);
snprintf(_GP(topBar).text, sizeof(_GP(topBar).text), "%s", get_translation(title)); snprintf(_GP(topBar).text, sizeof(_GP(topBar).text), "%s", get_translation(title));
_G(source_text_length) = real_text_sourcelen; _G(source_text_length) = real_text_sourcelen;

View File

@ -134,7 +134,7 @@ RuntimeScriptValue Sc_InventoryItem_CheckInteractionAvailable(void *self, const
API_OBJCALL_INT_PINT(ScriptInvItem, InventoryItem_CheckInteractionAvailable); API_OBJCALL_INT_PINT(ScriptInvItem, InventoryItem_CheckInteractionAvailable);
} }
// void (ScriptInvItem *iitem, char *_G(buff)) // void (ScriptInvItem *iitem, char *buff)
RuntimeScriptValue Sc_InventoryItem_GetName(void *self, const RuntimeScriptValue *params, int32_t param_count) { RuntimeScriptValue Sc_InventoryItem_GetName(void *self, const RuntimeScriptValue *params, int32_t param_count) {
API_OBJCALL_VOID_POBJ(ScriptInvItem, InventoryItem_GetName, char); API_OBJCALL_VOID_POBJ(ScriptInvItem, InventoryItem_GetName, char);
} }

View File

@ -480,7 +480,7 @@ void load_new_room(int newnum, CharacterInfo *forchar) {
// Make sure the room gfx and masks are matching game's native res // Make sure the room gfx and masks are matching game's native res
convert_room_background_to_game_res(); convert_room_background_to_game_res();
// _G(walkable_areas_temp) is used by the pathfinder to generate a // walkable_areas_temp is used by the pathfinder to generate a
// copy of the walkable areas - allocate it here to save time later // copy of the walkable areas - allocate it here to save time later
delete _G(walkable_areas_temp); delete _G(walkable_areas_temp);
_G(walkable_areas_temp) = BitmapHelper::CreateBitmap(_GP(thisroom).WalkAreaMask->GetWidth(), _GP(thisroom).WalkAreaMask->GetHeight(), 8); _G(walkable_areas_temp) = BitmapHelper::CreateBitmap(_GP(thisroom).WalkAreaMask->GetWidth(), _GP(thisroom).WalkAreaMask->GetHeight(), 8);

View File

@ -338,12 +338,12 @@ int PrepareTextScript(ccInstance *sci, const char **tsname) {
int RunScriptFunctionIfExists(ccInstance *sci, const char *tsname, int numParam, const RuntimeScriptValue *params) { int RunScriptFunctionIfExists(ccInstance *sci, const char *tsname, int numParam, const RuntimeScriptValue *params) {
int oldRestoreCount = _G(gameHasBeenRestored); int oldRestoreCount = _G(gameHasBeenRestored);
// First, save the current _G(ccError) state // First, save the current ccError state
// This is necessary because we might be attempting // This is necessary because we might be attempting
// to run Script B, while Script A is still running in the // to run Script B, while Script A is still running in the
// background. // background.
// If CallInstance here has an error, it would otherwise // If CallInstance here has an error, it would otherwise
// also abort Script A because _G(ccError) is a global variable. // also abort Script A because ccError is a global variable.
int cachedCcError = _G(ccError); int cachedCcError = _G(ccError);
_G(ccError) = 0; _G(ccError) = 0;

View File

@ -323,7 +323,7 @@ Bitmap glVirtualScreenWrap;
void IAGSEngine::SetVirtualScreen(BITMAP *bmp) { void IAGSEngine::SetVirtualScreen(BITMAP *bmp) {
if (!_G(gfxDriver)->UsesMemoryBackBuffer()) { if (!_G(gfxDriver)->UsesMemoryBackBuffer()) {
debug_script_warn("SetVirtualScreen: this plugin requires software graphics driver to work correctly."); debug_script_warn("SetVirtualScreen: this plugin requires software graphics driver to work correctly.");
// we let it continue since _G(gfxDriver) is supposed to ignore this request without throwing an exception // we let it continue since gfxDriver is supposed to ignore this request without throwing an exception
} }
if (bmp) { if (bmp) {

View File

@ -25,7 +25,4 @@
namespace AGS3 { namespace AGS3 {
//PluginObjectReader _G(pluginReaders)[MAX_PLUGIN_OBJECT_READERS];
//int _G(numPluginReaders) = 0;
} // namespace AGS3 } // namespace AGS3

View File

@ -28,8 +28,8 @@ namespace AGS3 {
class IAGSManagedObjectReader; class IAGSManagedObjectReader;
struct PluginObjectReader { struct PluginObjectReader {
IAGSManagedObjectReader *reader; IAGSManagedObjectReader *reader;
const char *type; const char *type;
}; };
} // namespace AGS3 } // namespace AGS3