Skip to content

Commit

Permalink
Fixed SIS status graphics bleeding through help menu
Browse files Browse the repository at this point in the history
Batched graphics of planet stats in scan menu
  • Loading branch information
Kruzen committed Mar 11, 2024
1 parent 17c66d1 commit 65f1757
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/uqm/planets/lander.c
Original file line number Diff line number Diff line change
Expand Up @@ -2405,7 +2405,8 @@ PlanetSide (POINT planetLoc)
if (crew_left == 0)
{
--GLOBAL_SIS (NumLanders);
DrawLanders ();
if (!optSubmenu)
DrawLanders ();

ReturnToOrbit ();
}
Expand All @@ -2421,7 +2422,15 @@ PlanetSide (POINT planetLoc)
ReturnToOrbit ();

AnimateLaunch (LanderFrame[6], FALSE);
DeltaSISGauges (crew_left, 0, 0);
if (!optSubmenu)
DeltaSISGauges (crew_left, 0, 0);
else
{// Get the crew from landers back but not draw anything
COUNT CrewCapacity = GetCrewPodCapacity ();
GLOBAL_SIS(CrewEnlisted) += crew_left;
if (GLOBAL_SIS(CrewEnlisted) > CrewCapacity)
GLOBAL_SIS(CrewEnlisted) = CrewCapacity;
}

if (PSD.ElementLevel)
{
Expand All @@ -2432,7 +2441,8 @@ PlanetSide (POINT planetLoc)
GLOBAL_SIS (TotalElementMass) +=
PSD.ElementAmounts[index];
}
DrawStorageBays (FALSE);
if (!optSubmenu)
DrawStorageBays (FALSE);
}

GLOBAL_SIS (TotalBioMass) += PSD.BiologicalLevel;
Expand Down
8 changes: 8 additions & 0 deletions src/uqm/planets/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ PrintCoarseScanPC (void)
SetContextForeGroundColor (optWhichCoarseScan ?
SCAN_INFO_COLOR : SCAN_PC_TITLE_COLOR);
SetContextFont (MicroFont);

BatchGraphics ();
PrintScanText (&t);

SetContextFont (SAFE_BOOL (TinyFont, TinyFontCond));
Expand Down Expand Up @@ -405,6 +407,8 @@ PrintCoarseScanPC (void)
sprintf (buf, "%d" STR_DEGREE_SIGN, val);
t.CharCount = (COUNT)~0;
PrintScanText (&t);

UnbatchGraphics ();
}

static void
Expand All @@ -425,6 +429,8 @@ PrintCoarseScan3DO (void)

GetPlanetTitle (buf, sizeof (buf));

BatchGraphics ();

t.align = ALIGN_CENTER;
t.baseline.x = RES_SCALE (ORIG_SIS_SCREEN_WIDTH >> 1);
t.baseline.y = SCAN_TITLE_Y;
Expand Down Expand Up @@ -562,6 +568,8 @@ PrintCoarseScan3DO (void)
sprintf (buf, "%u.%u%s", val / 10, val % 10, STR_EARTH_SIGN);
t.CharCount = (COUNT)~0;
PrintScanText (&t);

UnbatchGraphics ();
}

static void
Expand Down

0 comments on commit 65f1757

Please sign in to comment.