|
|
|
@@ -19,7 +19,7 @@
|
|
|
|
|
#include "starcon.h"
|
|
|
|
|
#include "lifeform.h"
|
|
|
|
|
#include "libs/graphics/gfx_common.h"
|
|
|
|
|
|
|
|
|
|
#include "options.h"
|
|
|
|
|
//Added by Chris
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
@@ -91,7 +91,251 @@ EraseCoarseScan (void)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
PrintCoarseScan (void)
|
|
|
|
|
PrintScanTitlePC (TEXT *t, RECT *r, char *txt, int xpos)
|
|
|
|
|
{
|
|
|
|
|
t->baseline.x = xpos;
|
|
|
|
|
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x15), 0x3B));
|
|
|
|
|
wsprintf (t->pStr, txt);
|
|
|
|
|
t->CharCount = (COUNT)~0;
|
|
|
|
|
DrawText (t);
|
|
|
|
|
TextRect (t, r, NULL_PTR);
|
|
|
|
|
t->baseline.x += r->extent.width;
|
|
|
|
|
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0xF, 0x00, 0x19), 0x3B));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
PrintCoarseScanPC (void)
|
|
|
|
|
{
|
|
|
|
|
#define SCAN_LEADING_PC 14
|
|
|
|
|
SIZE temp;
|
|
|
|
|
TEXT t;
|
|
|
|
|
RECT r;
|
|
|
|
|
STAMP s;
|
|
|
|
|
UNICODE buf[40];
|
|
|
|
|
|
|
|
|
|
SetSemaphore (GraphicsSem);
|
|
|
|
|
SetContext (SpaceContext);
|
|
|
|
|
|
|
|
|
|
if (CurStarDescPtr->Index == SOL_DEFINED)
|
|
|
|
|
{
|
|
|
|
|
if (pSolarSysState->pOrbitalDesc->pPrevDesc == &pSolarSysState->SunDesc[0])
|
|
|
|
|
wstrcpy (buf, GLOBAL_SIS (PlanetName));
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
switch (pSolarSysState->pOrbitalDesc->pPrevDesc
|
|
|
|
|
- pSolarSysState->PlanetDesc)
|
|
|
|
|
{
|
|
|
|
|
case 2: /* EARTH */
|
|
|
|
|
wstrcpy (buf, GAME_STRING (PLANET_NUMBER_BASE + 9));
|
|
|
|
|
break;
|
|
|
|
|
case 4: /* JUPITER */
|
|
|
|
|
switch (pSolarSysState->pOrbitalDesc
|
|
|
|
|
- pSolarSysState->MoonDesc)
|
|
|
|
|
{
|
|
|
|
|
case 0:
|
|
|
|
|
wstrcpy (buf, GAME_STRING (PLANET_NUMBER_BASE + 10));
|
|
|
|
|
break;
|
|
|
|
|
case 1:
|
|
|
|
|
wstrcpy (buf, GAME_STRING (PLANET_NUMBER_BASE + 11));
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
wstrcpy (buf, GAME_STRING (PLANET_NUMBER_BASE + 12));
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
wstrcpy (buf, GAME_STRING (PLANET_NUMBER_BASE + 13));
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case 5:
|
|
|
|
|
wstrcpy (buf, GAME_STRING (PLANET_NUMBER_BASE + 14));
|
|
|
|
|
break;
|
|
|
|
|
case 7:
|
|
|
|
|
wstrcpy (buf, GAME_STRING (PLANET_NUMBER_BASE + 15));
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
temp = pSolarSysState->pOrbitalDesc->data_index & ~PLANET_SHIELDED;
|
|
|
|
|
if (temp >= FIRST_GAS_GIANT)
|
|
|
|
|
wsprintf (buf, "%s", GAME_STRING (SCAN_STRING_BASE + 4 + 51));
|
|
|
|
|
else
|
|
|
|
|
wsprintf (buf, "%s %s",
|
|
|
|
|
GAME_STRING (SCAN_STRING_BASE + 4 + temp),
|
|
|
|
|
GAME_STRING (SCAN_STRING_BASE + 4 + 50));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
t.align = ALIGN_CENTER;
|
|
|
|
|
t.baseline.x = SIS_SCREEN_WIDTH >> 1;
|
|
|
|
|
t.baseline.y = 13;
|
|
|
|
|
t.pStr = buf;
|
|
|
|
|
t.CharCount = (COUNT)~0;
|
|
|
|
|
|
|
|
|
|
SetContextForeGroundColor (BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x15), 0x3B));
|
|
|
|
|
SetContextFont (MicroFont);
|
|
|
|
|
DrawText (&t);
|
|
|
|
|
SetContextFont (TinyFont);
|
|
|
|
|
ClearSemaphore (GraphicsSem);
|
|
|
|
|
|
|
|
|
|
#define LEFT_SIDE_BASELINE_X_PC 5
|
|
|
|
|
#define RIGHT_SIDE_BASELINE_X_PC (SIS_SCREEN_WIDTH - 75)
|
|
|
|
|
#define SCAN_BASELINE_Y_PC 40
|
|
|
|
|
|
|
|
|
|
t.baseline.y = SCAN_BASELINE_Y_PC;
|
|
|
|
|
t.align = ALIGN_LEFT;
|
|
|
|
|
|
|
|
|
|
SetSemaphore (GraphicsSem);
|
|
|
|
|
t.pStr = buf;
|
|
|
|
|
PrintScanTitlePC (&t, &r, "Orbit: ", LEFT_SIDE_BASELINE_X_PC);
|
|
|
|
|
temp = (SIZE)((pSolarSysState->SysInfo.PlanetInfo.PlanetToSunDist * 100L
|
|
|
|
|
+ (EARTH_RADIUS >> 1)) / EARTH_RADIUS);
|
|
|
|
|
if (temp >= 10 * 100)
|
|
|
|
|
wsprintf (buf, "%u.%u a.u.", temp / 100, (temp / 10) % 10);
|
|
|
|
|
else
|
|
|
|
|
wsprintf (buf, "%u.%02u a.u", temp / 100, temp % 100);
|
|
|
|
|
t.CharCount = (COUNT)~0;
|
|
|
|
|
DrawText (&t);
|
|
|
|
|
t.baseline.y += SCAN_LEADING_PC;
|
|
|
|
|
ClearSemaphore (GraphicsSem);
|
|
|
|
|
|
|
|
|
|
SetSemaphore (GraphicsSem);
|
|
|
|
|
t.pStr = buf;
|
|
|
|
|
PrintScanTitlePC (&t, &r, "Atmo: ", LEFT_SIDE_BASELINE_X_PC);
|
|
|
|
|
if (pSolarSysState->SysInfo.PlanetInfo.AtmoDensity == GAS_GIANT_ATMOSPHERE)
|
|
|
|
|
wsprintf (buf, "Super Thick");
|
|
|
|
|
else if (pSolarSysState->SysInfo.PlanetInfo.AtmoDensity == 0)
|
|
|
|
|
wsprintf (buf, "Vacuum");
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
temp = (pSolarSysState->SysInfo.PlanetInfo.AtmoDensity * 100
|
|
|
|
|
+ (EARTH_ATMOSPHERE >> 1)) / EARTH_ATMOSPHERE;
|
|
|
|
|
if (temp >= 10 * 100)
|
|
|
|
|
wsprintf (buf, "%u.%u atm", temp / 100, (temp / 10) % 10);
|
|
|
|
|
else
|
|
|
|
|
wsprintf (buf, "%u.%02u atm", temp / 100, temp % 100);
|
|
|
|
|
}
|
|
|
|
|
t.CharCount = (COUNT)~0;
|
|
|
|
|
DrawText (&t);
|
|
|
|
|
t.baseline.y += SCAN_LEADING_PC;
|
|
|
|
|
ClearSemaphore (GraphicsSem);
|
|
|
|
|
|
|
|
|
|
SetSemaphore (GraphicsSem);
|
|
|
|
|
t.pStr = buf;
|
|
|
|
|
PrintScanTitlePC (&t, &r, "Temp: ", LEFT_SIDE_BASELINE_X_PC);
|
|
|
|
|
wsprintf (buf, "%d^ c", pSolarSysState->SysInfo.PlanetInfo.SurfaceTemperature);
|
|
|
|
|
t.CharCount = (COUNT)~0;
|
|
|
|
|
DrawText (&t);
|
|
|
|
|
t.baseline.y += SCAN_LEADING_PC;
|
|
|
|
|
ClearSemaphore (GraphicsSem);
|
|
|
|
|
|
|
|
|
|
SetSemaphore (GraphicsSem);
|
|
|
|
|
t.pStr = buf;
|
|
|
|
|
PrintScanTitlePC (&t, &r, "Weather: ", LEFT_SIDE_BASELINE_X_PC);
|
|
|
|
|
if (pSolarSysState->SysInfo.PlanetInfo.AtmoDensity == 0)
|
|
|
|
|
wsprintf (buf, "None");
|
|
|
|
|
else
|
|
|
|
|
wsprintf (buf, "Class %u", pSolarSysState->SysInfo.PlanetInfo.Weather + 1);
|
|
|
|
|
t.CharCount = (COUNT)~0;
|
|
|
|
|
DrawText (&t);
|
|
|
|
|
t.baseline.y += SCAN_LEADING_PC;
|
|
|
|
|
ClearSemaphore (GraphicsSem);
|
|
|
|
|
|
|
|
|
|
SetSemaphore (GraphicsSem);
|
|
|
|
|
t.pStr = buf;
|
|
|
|
|
PrintScanTitlePC (&t, &r, "Tectonics: ", LEFT_SIDE_BASELINE_X_PC);
|
|
|
|
|
if (PLANSIZE (pSolarSysState->SysInfo.PlanetInfo.PlanDataPtr->Type) == GAS_GIANT)
|
|
|
|
|
wsprintf (buf, "None");
|
|
|
|
|
else
|
|
|
|
|
wsprintf (buf, "Class %u", pSolarSysState->SysInfo.PlanetInfo.Tectonics + 1);
|
|
|
|
|
t.CharCount = (COUNT)~0;
|
|
|
|
|
DrawText (&t);
|
|
|
|
|
ClearSemaphore (GraphicsSem);
|
|
|
|
|
|
|
|
|
|
t.baseline.y = SCAN_BASELINE_Y_PC;
|
|
|
|
|
|
|
|
|
|
SetSemaphore (GraphicsSem);
|
|
|
|
|
t.pStr = buf;
|
|
|
|
|
PrintScanTitlePC (&t, &r, "Mass: ", RIGHT_SIDE_BASELINE_X_PC);
|
|
|
|
|
{
|
|
|
|
|
DWORD tr;
|
|
|
|
|
|
|
|
|
|
tr = pSolarSysState->SysInfo.PlanetInfo.PlanetRadius;
|
|
|
|
|
if ((tr = (tr * tr * tr / 100L
|
|
|
|
|
* (DWORD)pSolarSysState->SysInfo.PlanetInfo.PlanetDensity
|
|
|
|
|
+ (DWORD)((100L * 100L) >> 1))
|
|
|
|
|
/ (DWORD)(100L * 100L)) == 0)
|
|
|
|
|
tr = 1;
|
|
|
|
|
if (tr >= 10 * 100)
|
|
|
|
|
wsprintf (buf, "%lu.%lu e.s", tr / 100, (tr / 10) % 10);
|
|
|
|
|
else
|
|
|
|
|
wsprintf (buf, "%lu.%02lu e.s", tr / 100, tr % 100);
|
|
|
|
|
}
|
|
|
|
|
t.CharCount = (COUNT)~0;
|
|
|
|
|
DrawText (&t);
|
|
|
|
|
t.baseline.y += SCAN_LEADING_PC;
|
|
|
|
|
ClearSemaphore (GraphicsSem);
|
|
|
|
|
|
|
|
|
|
SetSemaphore (GraphicsSem);
|
|
|
|
|
t.pStr = buf;
|
|
|
|
|
PrintScanTitlePC (&t, &r, "Radius: ", RIGHT_SIDE_BASELINE_X_PC);
|
|
|
|
|
if ((temp = pSolarSysState->SysInfo.PlanetInfo.PlanetRadius) >= 10 * 100)
|
|
|
|
|
wsprintf (buf, "%u.%u e.s.", temp / 100, (temp / 10) % 10);
|
|
|
|
|
else
|
|
|
|
|
wsprintf (buf, "%u.%02u e.s", temp / 100, temp % 100);
|
|
|
|
|
t.CharCount = (COUNT)~0;
|
|
|
|
|
DrawText (&t);
|
|
|
|
|
t.baseline.y += SCAN_LEADING_PC;
|
|
|
|
|
ClearSemaphore (GraphicsSem);
|
|
|
|
|
|
|
|
|
|
SetSemaphore (GraphicsSem);
|
|
|
|
|
t.pStr = buf;
|
|
|
|
|
PrintScanTitlePC (&t, &r, "Gravity: ", RIGHT_SIDE_BASELINE_X_PC);
|
|
|
|
|
if ((temp = pSolarSysState->SysInfo.PlanetInfo.SurfaceGravity) >= 10 * 100)
|
|
|
|
|
wsprintf (buf, "%u.%u g.", temp / 100, (temp / 10) % 10);
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (temp == 0)
|
|
|
|
|
temp = 1;
|
|
|
|
|
wsprintf (buf, "%u.%02u g.", temp / 100, temp % 100);
|
|
|
|
|
}
|
|
|
|
|
t.CharCount = (COUNT)~0;
|
|
|
|
|
DrawText (&t);
|
|
|
|
|
t.baseline.y += SCAN_LEADING_PC;
|
|
|
|
|
ClearSemaphore (GraphicsSem);
|
|
|
|
|
|
|
|
|
|
SetSemaphore (GraphicsSem);
|
|
|
|
|
t.pStr = buf;
|
|
|
|
|
PrintScanTitlePC (&t, &r, "Day: ", RIGHT_SIDE_BASELINE_X_PC);
|
|
|
|
|
if (pSolarSysState->SysInfo.PlanetInfo.RotationPeriod < 240 * 10)
|
|
|
|
|
{
|
|
|
|
|
temp = (SIZE)(pSolarSysState->SysInfo.PlanetInfo.RotationPeriod * 10 / 24);
|
|
|
|
|
wsprintf (buf, "%u.%02u days", temp / 100, temp % 100);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
temp = (SIZE)((pSolarSysState->SysInfo.PlanetInfo.RotationPeriod
|
|
|
|
|
+ (24 >> 1)) / 24);
|
|
|
|
|
wsprintf (buf, "%u.%u days", temp / 10, temp % 10);
|
|
|
|
|
}
|
|
|
|
|
t.CharCount = (COUNT)~0;
|
|
|
|
|
DrawText (&t);
|
|
|
|
|
t.baseline.y += SCAN_LEADING_PC;
|
|
|
|
|
ClearSemaphore (GraphicsSem);
|
|
|
|
|
|
|
|
|
|
SetSemaphore (GraphicsSem);
|
|
|
|
|
t.pStr = buf;
|
|
|
|
|
PrintScanTitlePC (&t, &r, "Tilt: ", RIGHT_SIDE_BASELINE_X_PC);
|
|
|
|
|
if ((temp = pSolarSysState->SysInfo.PlanetInfo.AxialTilt) < 0)
|
|
|
|
|
temp = -temp;
|
|
|
|
|
wsprintf (buf, "%u^", temp);
|
|
|
|
|
t.CharCount = (COUNT)~0;
|
|
|
|
|
DrawText (&t);
|
|
|
|
|
ClearSemaphore (GraphicsSem);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
PrintCoarseScan3DO (void)
|
|
|
|
|
{
|
|
|
|
|
#define SCAN_LEADING 19
|
|
|
|
|
SIZE temp;
|
|
|
|
@@ -540,7 +784,10 @@ PickPlanetSide (INPUT_STATE InputState, PMENU_STATE pMS)
|
|
|
|
|
return (FALSE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PrintCoarseScan ();
|
|
|
|
|
if (optPCscan)
|
|
|
|
|
PrintCoarseScanPC ();
|
|
|
|
|
else
|
|
|
|
|
PrintCoarseScan3DO ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DrawMenuStateStrings (PM_MIN_SCAN, DISPATCH_SHUTTLE);
|
|
|
|
@@ -994,7 +1241,10 @@ ScanSystem (void)
|
|
|
|
|
|
|
|
|
|
DrawMenuStateStrings (PM_MIN_SCAN, MenuState.CurState);
|
|
|
|
|
|
|
|
|
|
PrintCoarseScan ();
|
|
|
|
|
if (optPCscan)
|
|
|
|
|
PrintCoarseScanPC ();
|
|
|
|
|
else
|
|
|
|
|
PrintCoarseScan3DO ();
|
|
|
|
|
|
|
|
|
|
pMenuState = &MenuState;
|
|
|
|
|
DoInput ((PVOID)&MenuState);
|
|
|
|
|