Wing Commander
Reconstructed Win32 source (1996)
Loading...
Searching...
No Matches
trainsim.c File Reference

Training simulator: menus, pilot name entry, high scores and the mission loop. More...

#include "wc1.h"

Go to the source code of this file.

Functions

unsigned short EraseTextContextBackground (TextContext *context)
int DisplayTrainSimHighScoreTable (short phase)
int AnimateTrainSimTitle (void)
unsigned char * GetHighScoreEntry (short i)
unsigned int GetHighScoreValue (short i)
unsigned int SetHighScoreEntry (short i, unsigned char b, unsigned int v)
void SortTrainSimHighScores (void)
short FindTrainSimHighScore (short pilot)
short InsertTrainSimHighScore (short pilot, unsigned int score)
short RandomBelowOrEqual (short n)
void InitializeTrainSimHighScores (void)
short IsHighScoreSlotUsed (short i)
short RandomBelow (short n)
void AddRandomTrainSimHighScores (void)
void DrawTextInputCursor (char character)
void ClearTextInputCharacter (short character)
void ClearNextTextInputCharacter (short character)
short ReadTextInput (char *destination, short maximumLength, short mode)
void ReadRequiredPilotField (short x, short y, const char *label, char *destination, short maximumLength)
void PromptForPilotField (short x, short y, const char *label, char *destination, short maximumLength, const char *defaultText)
void InitializeTrainSimTextPanel (void)
void ShowTrainSimTextMessage (const char *message)
void EnterPilotNameAndCallsign (void)
void UpdateTrainSimHighScores (int score)
void ShowTrainSimHighScores (void)
struct Shape * LoadTrainSimOpponentShape (int opponent)
short SelectTrainSimMission (short *mission)
void RunTrainSim (void)

Variables

int DAT_00469da0 = 10
ShortRect stTrainSimPanelBounds
Viewport stTrainSimPanelViewport = {0}
char szTrainSimTitle [24] = "SQUADRON: TRAINSIM"
unsigned char * apszBuiltInHighScoreNames [6]
TitleMenuRegion aTrainSimMissionRegions [5]
int nTrainSimActive = 0
short nTrainSimMission = 0
short nArcadeWave = 0
Viewport stTrainSimulatorHighScoreBufView
int nCurrentArcadeScore
TextContext stTrainSimTxtContext
Viewport stTrainSimHighScoreDisplayViewport
TextContext stTrainSimHighScoreTextContext
short nArcadeTimeRemaining
HighScoreEntry aHighScoreEntriesArray [6]
int nArcadeWaveBonusValue

Detailed Description

Training simulator: menus, pilot name entry, high scores and the mission loop.

Address range 425c30-4272ef. The initialized panel, resource tables and state precede this unit's name and UI literal pool.

Definition in file trainsim.c.

Function Documentation

◆ AddRandomTrainSimHighScores()

◆ AnimateTrainSimTitle()

◆ ClearNextTextInputCharacter()

void ClearNextTextInputCharacter ( short character)

◆ ClearTextInputCharacter()

◆ DisplayTrainSimHighScoreTable()

◆ DrawTextInputCursor()

◆ EnterPilotNameAndCallsign()

◆ EraseTextContextBackground()

◆ FindTrainSimHighScore()

◆ GetHighScoreEntry()

unsigned char * GetHighScoreEntry ( short i)

◆ GetHighScoreValue()

unsigned int GetHighScoreValue ( short i)

◆ InitializeTrainSimHighScores()

◆ InitializeTrainSimTextPanel()

◆ InsertTrainSimHighScore()

short InsertTrainSimHighScore ( short pilot,
unsigned int score )

◆ IsHighScoreSlotUsed()

short IsHighScoreSlotUsed ( short i)

◆ LoadTrainSimOpponentShape()

struct Shape * LoadTrainSimOpponentShape ( int opponent)

◆ PromptForPilotField()

void PromptForPilotField ( short x,
short y,
const char * label,
char * destination,
short maximumLength,
const char * defaultText )

◆ RandomBelow()

short RandomBelow ( short n)

Definition at line 29 of file mathfp.c.

◆ RandomBelowOrEqual()

short RandomBelowOrEqual ( short n)

Definition at line 59 of file mathfp.c.

◆ ReadRequiredPilotField()

void ReadRequiredPilotField ( short x,
short y,
const char * label,
char * destination,
short maximumLength )

◆ ReadTextInput()

◆ RunTrainSim()

◆ SelectTrainSimMission()

◆ SetHighScoreEntry()

unsigned int SetHighScoreEntry ( short i,
unsigned char b,
unsigned int v )

◆ ShowTrainSimHighScores()

◆ ShowTrainSimTextMessage()

◆ SortTrainSimHighScores()

void SortTrainSimHighScores ( void )

◆ UpdateTrainSimHighScores()

Variable Documentation

◆ aHighScoreEntriesArray

◆ apszBuiltInHighScoreNames

unsigned char* apszBuiltInHighScoreNames[6]
Initial value:
= {
"BISHOP", "GOBLIN", "JEFFTEP", "MANGLER", "THE MAN", "MONGO"
}

Definition at line 21 of file trainsim.c.

Referenced by GetHighScoreEntry().

◆ aTrainSimMissionRegions

TitleMenuRegion aTrainSimMissionRegions[5]
Initial value:
= {
{ 1, 47, 29, 67, 49 },
{ 1, 47, 89, 67, 109 },
{ 1, 251, 29, 271, 49 },
{ 1, 251, 89, 271, 109 },
{ -1, 0, 0, 0, 0 }
}

Definition at line 24 of file trainsim.c.

Referenced by SelectTrainSimMission(), and UpdateTrainSimMenuCursor().

◆ DAT_00469da0

int DAT_00469da0 = 10

Definition at line 14 of file trainsim.c.

◆ nArcadeTimeRemaining

short nArcadeTimeRemaining

◆ nArcadeWave

short nArcadeWave = 0

◆ nArcadeWaveBonusValue

int nArcadeWaveBonusValue

Definition at line 42 of file trainsim.c.

Referenced by GetArcadeBonus(), RenderSpaceViewFrame(), and UpdateArcadeScoreDisplay().

◆ nCurrentArcadeScore

int nCurrentArcadeScore

◆ nTrainSimActive

◆ nTrainSimMission

short nTrainSimMission = 0

Definition at line 32 of file trainsim.c.

Referenced by GetArcadeBonus(), RunTrainSim(), and UpdateArcadeScoreDisplay().

◆ stTrainSimHighScoreDisplayViewport

Viewport stTrainSimHighScoreDisplayViewport

Definition at line 38 of file trainsim.c.

Referenced by DisplayTrainSimHighScoreTable(), and ShowTrainSimHighScores().

◆ stTrainSimHighScoreTextContext

TextContext stTrainSimHighScoreTextContext

Definition at line 39 of file trainsim.c.

Referenced by ShowTrainSimHighScores().

◆ stTrainSimPanelBounds

ShortRect stTrainSimPanelBounds
Initial value:
= {
0x30, 0x1d, 0x110, 0x6d
}

Definition at line 17 of file trainsim.c.

Referenced by AnimateTrainSimTitle(), DisplayTrainSimHighScoreTable(), InitializeTrainSimTextPanel(), SelectTrainSimMission(), and ShowTrainSimHighScores().

◆ stTrainSimPanelViewport

◆ stTrainSimTxtContext

◆ stTrainSimulatorHighScoreBufView

Viewport stTrainSimulatorHighScoreBufView

Definition at line 35 of file trainsim.c.

Referenced by DisplayTrainSimHighScoreTable(), and ShowTrainSimHighScores().

◆ szTrainSimTitle

char szTrainSimTitle[24] = "SQUADRON: TRAINSIM"

Definition at line 20 of file trainsim.c.

Referenced by ShowTrainSimHighScores().