From 5894857f5b44d1cba900ba1a34df9b190e154daa Mon Sep 17 00:00:00 2001 From: avolkov Date: Thu, 17 Dec 2009 01:42:05 +0000 Subject: [PATCH] Fix unused parameter warning; also minimize GLOBAL_SIS() accesses while drawing savegame summary git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3434 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/uqm/gameopt.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sc2/src/uqm/gameopt.c b/sc2/src/uqm/gameopt.c index da2b580af..58f7e9561 100644 --- a/sc2/src/uqm/gameopt.c +++ b/sc2/src/uqm/gameopt.c @@ -475,7 +475,7 @@ DrawSaveLoad (PICK_GAME_STATE *pickState) } static void -DrawSavegameCargo (PICK_GAME_STATE *pickState, COUNT gameIndex) +DrawSavegameCargo (SIS_STATE *sisState) { COUNT i; STAMP s; @@ -528,7 +528,7 @@ DrawSavegameCargo (PICK_GAME_STATE *pickState, COUNT gameIndex) s.origin.y += ELEMENT_SPACING_Y; // print element amount SetContextForeGroundColor (cargo_color[i]); - snprintf (buf, sizeof buf, "%u", GLOBAL_SIS (ElementAmounts[i])); + snprintf (buf, sizeof buf, "%u", sisState->ElementAmounts[i]); t.CharCount = (COUNT)~0; font_DrawText (&t); t.baseline.y += ELEMENT_SPACING_Y; @@ -543,7 +543,7 @@ DrawSavegameCargo (PICK_GAME_STATE *pickState, COUNT gameIndex) t.baseline.x = 50 + SUMMARY_X_OFFS; t.baseline.y = s.origin.y + 3; SetContextForeGroundColor (cargo_color[i]); - snprintf (buf, sizeof buf, "%u", GLOBAL_SIS (TotalBioMass)); + snprintf (buf, sizeof buf, "%u", sisState->TotalBioMass); t.CharCount = (COUNT)~0; font_DrawText (&t); @@ -650,7 +650,7 @@ DrawSavegameSummary (PICK_GAME_STATE *pickState, COUNT gameIndex) } else { - DrawSavegameCargo (pickState, gameIndex); + DrawSavegameCargo (&pSD->SS); SetContext (RadarContext); // Hack RadarContext so we can use standard Lander display funcs @@ -666,7 +666,7 @@ DrawSavegameSummary (PICK_GAME_STATE *pickState, COUNT gameIndex) SetContextClipRect (&OldRect); SetContext (SpaceContext); - snprintf (buf, sizeof buf, "%u", GLOBAL_SIS (ResUnits)); + snprintf (buf, sizeof buf, "%u", pSD->SS.ResUnits); t.baseline.y = 102; SetContextForeGroundColor ( BUILD_COLOR (MAKE_RGB15 (0x10, 0x00, 0x10), 0x01)); @@ -685,8 +685,8 @@ DrawSavegameSummary (PICK_GAME_STATE *pickState, COUNT gameIndex) t.baseline.y = 139 + 6; t.align = ALIGN_LEFT; t.pStr = buf; - starPt.x = LOGX_TO_UNIVERSE (GLOBAL_SIS (log_x)); - starPt.y = LOGY_TO_UNIVERSE (GLOBAL_SIS (log_y)); + starPt.x = LOGX_TO_UNIVERSE (pSD->SS.log_x); + starPt.y = LOGY_TO_UNIVERSE (pSD->SS.log_y); switch (pSD->Activity) { case IN_LAST_BATTLE: @@ -740,7 +740,7 @@ DrawSavegameSummary (PICK_GAME_STATE *pickState, COUNT gameIndex) GAME_STRING (PLANET_NUMBER_BASE + 32)); break; case IN_PLANET_ORBIT: - utf8StringCopy (buf, sizeof (buf), GLOBAL_SIS (PlanetName)); + utf8StringCopy (buf, sizeof (buf), pSD->SS.PlanetName); break; default: snprintf (buf, sizeof buf, "%03u.%01u : %03u.%01u",