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
This commit is contained in:
avolkov
2009-12-17 01:42:05 +00:00
parent 40d81864d4
commit 5894857f5b
+8 -8
View File
@@ -475,7 +475,7 @@ DrawSaveLoad (PICK_GAME_STATE *pickState)
} }
static void static void
DrawSavegameCargo (PICK_GAME_STATE *pickState, COUNT gameIndex) DrawSavegameCargo (SIS_STATE *sisState)
{ {
COUNT i; COUNT i;
STAMP s; STAMP s;
@@ -528,7 +528,7 @@ DrawSavegameCargo (PICK_GAME_STATE *pickState, COUNT gameIndex)
s.origin.y += ELEMENT_SPACING_Y; s.origin.y += ELEMENT_SPACING_Y;
// print element amount // print element amount
SetContextForeGroundColor (cargo_color[i]); 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; t.CharCount = (COUNT)~0;
font_DrawText (&t); font_DrawText (&t);
t.baseline.y += ELEMENT_SPACING_Y; 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.x = 50 + SUMMARY_X_OFFS;
t.baseline.y = s.origin.y + 3; t.baseline.y = s.origin.y + 3;
SetContextForeGroundColor (cargo_color[i]); SetContextForeGroundColor (cargo_color[i]);
snprintf (buf, sizeof buf, "%u", GLOBAL_SIS (TotalBioMass)); snprintf (buf, sizeof buf, "%u", sisState->TotalBioMass);
t.CharCount = (COUNT)~0; t.CharCount = (COUNT)~0;
font_DrawText (&t); font_DrawText (&t);
@@ -650,7 +650,7 @@ DrawSavegameSummary (PICK_GAME_STATE *pickState, COUNT gameIndex)
} }
else else
{ {
DrawSavegameCargo (pickState, gameIndex); DrawSavegameCargo (&pSD->SS);
SetContext (RadarContext); SetContext (RadarContext);
// Hack RadarContext so we can use standard Lander display funcs // Hack RadarContext so we can use standard Lander display funcs
@@ -666,7 +666,7 @@ DrawSavegameSummary (PICK_GAME_STATE *pickState, COUNT gameIndex)
SetContextClipRect (&OldRect); SetContextClipRect (&OldRect);
SetContext (SpaceContext); SetContext (SpaceContext);
snprintf (buf, sizeof buf, "%u", GLOBAL_SIS (ResUnits)); snprintf (buf, sizeof buf, "%u", pSD->SS.ResUnits);
t.baseline.y = 102; t.baseline.y = 102;
SetContextForeGroundColor ( SetContextForeGroundColor (
BUILD_COLOR (MAKE_RGB15 (0x10, 0x00, 0x10), 0x01)); 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.baseline.y = 139 + 6;
t.align = ALIGN_LEFT; t.align = ALIGN_LEFT;
t.pStr = buf; t.pStr = buf;
starPt.x = LOGX_TO_UNIVERSE (GLOBAL_SIS (log_x)); starPt.x = LOGX_TO_UNIVERSE (pSD->SS.log_x);
starPt.y = LOGY_TO_UNIVERSE (GLOBAL_SIS (log_y)); starPt.y = LOGY_TO_UNIVERSE (pSD->SS.log_y);
switch (pSD->Activity) switch (pSD->Activity)
{ {
case IN_LAST_BATTLE: case IN_LAST_BATTLE:
@@ -740,7 +740,7 @@ DrawSavegameSummary (PICK_GAME_STATE *pickState, COUNT gameIndex)
GAME_STRING (PLANET_NUMBER_BASE + 32)); GAME_STRING (PLANET_NUMBER_BASE + 32));
break; break;
case IN_PLANET_ORBIT: case IN_PLANET_ORBIT:
utf8StringCopy (buf, sizeof (buf), GLOBAL_SIS (PlanetName)); utf8StringCopy (buf, sizeof (buf), pSD->SS.PlanetName);
break; break;
default: default:
snprintf (buf, sizeof buf, "%03u.%01u : %03u.%01u", snprintf (buf, sizeof buf, "%03u.%01u : %03u.%01u",