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

Personnel database, campaign chalkboard and pilot transfer. More...

#include "game.h"

Go to the source code of this file.

Enumerations

enum  PersonnelMenuKey {
  PERSONNEL_KEY_0 = 0x0b , PERSONNEL_KEY_W = 0x11 , PERSONNEL_KEY_T = 0x14 , PERSONNEL_KEY_ENTER = 0x1c ,
  PERSONNEL_KEY_S = 0x1f , PERSONNEL_KEY_D = 0x20 , PERSONNEL_KEY_L = 0x26 , PERSONNEL_KEY_C = 0x2e ,
  PERSONNEL_KEY_SPACE = 0x39
}

Functions

void PollPersonnelMenuInput (void)
void InitializeCampaignChalkboardScreen (short cockpitVariant)
void RefreshCampaignChalkboardScreen (short cockpitVariant)
void DrawCampaignChalkboardFrame (unsigned short frame)
void DrawPersonnelMenuBackdrop (void *scenePacket)
short LoadSelectedPilotCampaign (void)
unsigned short HasSavedPilotCampaign (void)
void OpenDiskDataFile (short logicalFile)
void RestorePersonnelMenuBackground (Viewport *viewport)
void DrawPilotSaveMenuChoices (short choice)
void DrawFormattedText (const char *format,...)
void DrawPersonnelSourceChoices (short choice)
void InitializeTextContextFromFont (TextContext *context, short fontIndex, unsigned char colour, signed char background)
void DrawPersonnelMenuChoices (short choice)
void DrawPersonnelFileSlot (short slot)
void DrawTransferredPilotRow (short row)
void HighlightPersonnelFileSlot (short choice)
short SelectPersonnelFileSlot (void)
void HighlightTransferredPilot (short choice)
short SelectTransferredPilot (short count)
void SetTextCursor (unsigned short a, unsigned short b)
void CopyHugeMemoryOverlapSafe (void *destination, void *source, int count)
void RunPilotSaveLoadMenu (void)
short SelectLegacyGameSource (void)
short LocateLegacySaveGame (short source)
void ShowNoTransferablePilots (void)
short RunPilotDatabaseMenu (void)

Variables

unsigned char * g_pCockpitBackgroundPacket = 0
unsigned char * g_apCockpitVduOverlayShapes [2] = { 0 }
int g_nLegacySaveSource = 0
const char * g_apszPilotRankNames [5]
const char * g_apszShortPilotRankNames [5]
static char g_szSaveSlotSignature [0x24]
PersonnelFileSlot * g_apPersonnelFileSlots [8] = { 0 }
PilotProfile * g_apPersonnelPilotProfiles [8] = { 0 }
short g_nPersonnelMenuHighlight = -1
void * g_pPersonnelCampaignSnapshot = 0
static char g_szPersonnelFileName [] = "savegame.wc2"
unsigned char * g_pPersonnelMenuBackdrop = 0
short g_sPersonnelPreviousInput = -128
short g_bPersonnelMenuDrawing = 1
const char * g_apszSaveGameFileNames [3]
signed char g_bPersonnelPrimaryInputDown = 0

Detailed Description

Personnel database, campaign chalkboard and pilot transfer.

Definition in file personnel.c.

Enumeration Type Documentation

◆ PersonnelMenuKey

Enumerator
PERSONNEL_KEY_0 
PERSONNEL_KEY_W 
PERSONNEL_KEY_T 
PERSONNEL_KEY_ENTER 
PERSONNEL_KEY_S 
PERSONNEL_KEY_D 
PERSONNEL_KEY_L 
PERSONNEL_KEY_C 
PERSONNEL_KEY_SPACE 

Definition at line 48 of file personnel.c.

Function Documentation

◆ CopyHugeMemoryOverlapSafe()

void CopyHugeMemoryOverlapSafe ( void * destination,
void * source,
int count )

Definition at line 9 of file hugemove.c.

◆ DrawCampaignChalkboardFrame()

◆ DrawFormattedText()

void DrawFormattedText ( const char * format,
... )

Definition at line 103 of file textfmt.c.

◆ DrawPersonnelFileSlot()

◆ DrawPersonnelMenuBackdrop()

◆ DrawPersonnelMenuChoices()

◆ DrawPersonnelSourceChoices()

◆ DrawPilotSaveMenuChoices()

◆ DrawTransferredPilotRow()

◆ HasSavedPilotCampaign()

◆ HighlightPersonnelFileSlot()

◆ HighlightTransferredPilot()

◆ InitializeCampaignChalkboardScreen()

◆ InitializeTextContextFromFont()

void InitializeTextContextFromFont ( TextContext * context,
short fontIndex,
unsigned char colour,
signed char background )

Definition at line 254 of file disk.c.

◆ LoadSelectedPilotCampaign()

◆ LocateLegacySaveGame()

◆ OpenDiskDataFile()

◆ PollPersonnelMenuInput()

◆ RefreshCampaignChalkboardScreen()

◆ RestorePersonnelMenuBackground()

◆ RunPilotDatabaseMenu()

short RunPilotDatabaseMenu ( void )

Definition at line 1400 of file personnel.c.

References AllocateTaggedMemory(), AllocateViewport(), Viewport::bottom, PilotNameVariables::callsign, PilotProfile::callsign, PilotRecord::callsign, SaveGameDiskRecord::campaign, SaveGameDiskCampaignState::campaignIndex, ClearViewport(), InputManagerState::cursorShape, SceneResourceTable::data, DisableMouseCursorDrawing(), DrawFormattedText(), DrawPersonnelMenuBackdrop(), DrawPersonnelMenuChoices(), DrawSpriteDefault(), EnableMouseCursorDrawing(), FetchDiskPacketRetrying(), PilotProfile::field_41, PilotProfile::field_43, PilotNameVariables::firstName, PilotProfile::firstName, FlushInputEvents(), free_viewport(), FreePacketAndClear(), g_101_stScrViewInfo, g_10_nMenuDarkColour, g_18_pEventManager, g_1_nCockpitArchiveVariantNumber, g_1_szLegacySaveFolder, g_37_stPersonnelMousePointerState, g_3_apszPersonnelImportCaptionsTable, g_3_stDefaultStringContext, g_6_szDefaultTextBufferText, g_apszShortPilotRankNames, g_bPersonnelMenuDrawing, g_bPrimaryViewBufferColour, g_cCurrentKey, g_cSecondaryViewBufferColour, g_nMenuSelectedCol, g_nPersonnelMenuHighlight, g_pActiveScenePacket, g_pPersonnelMenuBackdrop, g_stCurrentPilotProfile, g_stPilotNameVariables, g_stSceneTextList, g_stSceneZoneTable, g_stSecondaryViewBufferBlock, InitializeTextContextFromFont(), PilotRecord::kills, PilotNameVariables::lastName, PilotProfile::lastName, Viewport::left, LoadStartingCampaignGlobals(), LocateLegacySaveGame(), PilotRecord::missions, PilotRecord::name, SaveGameDiskRecord::occupied, OpenDiskDataFile(), PERSONNEL_KEY_C, PERSONNEL_KEY_ENTER, PERSONNEL_KEY_SPACE, PERSONNEL_KEY_T, PersonnelDriveHook(), SaveGameDiskRecord::pilots, PollPersonnelMenuInput(), PilotProfile::rank, PilotRecord::rank, ReadPersonnelTextField(), RefreshMemoryStatusOverlay(), ReleasePacketHandle(), ReleasePacketSlot(), ReportFatalErrorCode(), RestorePersonnelMenuBackground(), Viewport::right, RunPilotDatabaseMenu(), SaveAndFreeTemporaryCampaignGlobals(), SelectLegacyGameSource(), SelectTransferredPilot(), SetInputViewport(), SetMenuInputPump(), SetMouseCursorShape(), SetPersonnelMousePosition(), SetTextContext(), SetTextCursor(), ShowNoTransferablePilots(), TextContext::text, Viewport::top, TextContext::viewport, MouseCursorState::x, and MouseCursorState::y.

Referenced by close_behind(), RunGameApplication(), and RunPilotDatabaseMenu().

◆ RunPilotSaveLoadMenu()

void RunPilotSaveLoadMenu ( void )

Definition at line 827 of file personnel.c.

References AllocateTaggedMemory(), PilotNameVariables::callsign, PilotProfile::callsign, ClearViewport(), CopyHugeMemoryOverlapSafe(), InputManagerState::cursorShape, SceneResourceTable::data, PersonnelFileSlot::description, DisableMouseCursorDrawing(), DrawFormattedText(), DrawPersonnelMenuBackdrop(), DrawPilotSaveMenuChoices(), DrawSpriteDefault(), EnableMouseCursorDrawing(), FetchDiskPacketRetrying(), PilotProfile::field_41, PilotProfile::field_43, PilotNameVariables::firstName, PilotProfile::firstName, FreePacketAndClear(), g_101_stScrViewInfo, g_10_nMenuDarkColour, g_18_pEventManager, g_1_nCockpitArchiveVariantNumber, g_37_stPersonnelMousePointerState, g_3_nOptionMessageColour, g_3_stDefaultStringContext, g_6_szDefaultTextBufferText, g_apPersonnelFileSlots, g_apPersonnelPilotProfiles, g_bPersonnelMenuDrawing, g_cCurrentKey, g_nMenuSelectedCol, g_nOriginDevUnlock, g_nPersonnelMenuHighlight, g_pActiveScenePacket, g_pCampaignGlobals, g_pPersonnelCampaignSnapshot, g_pPersonnelMenuBackdrop, g_stCurrentPilotProfile, g_stDefaultPilotProfile, g_stPilotNameVariables, g_stSceneTextList, g_stSceneZoneTable, g_stSecondaryViewBufferBlock, g_szPersonnelFileName, g_szSaveSlotSignature, InitializeTextContextFromFont(), PilotNameVariables::lastName, PilotProfile::lastName, PersonnelFileSlot::occupied, PERSONNEL_KEY_D, PERSONNEL_KEY_ENTER, PERSONNEL_KEY_L, PERSONNEL_KEY_S, PERSONNEL_KEY_SPACE, PollPersonnelMenuInput(), PilotProfile::rank, ReadPersonnelTextField(), RefreshMemoryStatusOverlay(), ReleasePacketHandle(), ReleasePacketSlot(), ReportFatalErrorCode(), RestorePersonnelMenuBackground(), RunPilotSaveLoadMenu(), SelectPersonnelFileSlot(), ServiceSoundSystem(), SetInputViewport(), SetMouseCursorShape(), SetPersonnelMousePosition(), SetTextContext(), SetTextCursor(), TextContext::text, TextContext::viewport, WaitForQueuedInputPress(), CampaignGlobals::wordCount, MouseCursorState::x, and MouseCursorState::y.

Referenced by DrawTextAt(), RunCampaignChalkboardMenu(), and RunPilotSaveLoadMenu().

◆ SelectLegacyGameSource()

◆ SelectPersonnelFileSlot()

◆ SelectTransferredPilot()

◆ SetTextCursor()

void SetTextCursor ( unsigned short a,
unsigned short b )

Definition at line 172 of file eventmgr.c.

◆ ShowNoTransferablePilots()

Variable Documentation

◆ g_apCockpitVduOverlayShapes

unsigned char* g_apCockpitVduOverlayShapes[2] = { 0 }

◆ g_apPersonnelFileSlots

PersonnelFileSlot* g_apPersonnelFileSlots[8] = { 0 }

Definition at line 32 of file personnel.c.

Referenced by DrawPersonnelFileSlot(), and RunPilotSaveLoadMenu().

◆ g_apPersonnelPilotProfiles

PilotProfile* g_apPersonnelPilotProfiles[8] = { 0 }

Definition at line 33 of file personnel.c.

Referenced by DrawPersonnelFileSlot(), and RunPilotSaveLoadMenu().

◆ g_apszPilotRankNames

const char* g_apszPilotRankNames[5]
Initial value:
= {
"2ND LT.",
"1ST LT.",
"CAPTAIN",
"MAJOR",
"LT. COL."
}

Definition at line 11 of file personnel.c.

Referenced by DrawPersonnelFileSlot(), and ExpandCommMessageTokens().

◆ g_apszSaveGameFileNames

const char* g_apszSaveGameFileNames[3]
Initial value:
= {
"savegame.wld",
"savegame.wld",
"crusade.wld"
}

Definition at line 40 of file personnel.c.

Referenced by LocateLegacySaveGame().

◆ g_apszShortPilotRankNames

const char* g_apszShortPilotRankNames[5]
Initial value:
= {
"2ND LT",
"1ST LT",
"CAPT.",
"MAJOR",
"LT COL"
}

Definition at line 18 of file personnel.c.

Referenced by DrawPersonnelFileSlot(), and RunPilotDatabaseMenu().

◆ g_bPersonnelMenuDrawing

◆ g_bPersonnelPrimaryInputDown

signed char g_bPersonnelPrimaryInputDown = 0

Definition at line 45 of file personnel.c.

Referenced by PollPersonnelMenuInput().

◆ g_nLegacySaveSource

int g_nLegacySaveSource = 0

Definition at line 10 of file personnel.c.

Referenced by LocateLegacySaveGame(), and SelectLegacyGameSource().

◆ g_nPersonnelMenuHighlight

◆ g_pCockpitBackgroundPacket

unsigned char* g_pCockpitBackgroundPacket = 0

◆ g_pPersonnelCampaignSnapshot

void* g_pPersonnelCampaignSnapshot = 0

Definition at line 35 of file personnel.c.

Referenced by RunPilotSaveLoadMenu().

◆ g_pPersonnelMenuBackdrop

◆ g_sPersonnelPreviousInput

short g_sPersonnelPreviousInput = -128

Definition at line 38 of file personnel.c.

Referenced by PollPersonnelMenuInput().

◆ g_szPersonnelFileName

char g_szPersonnelFileName[] = "savegame.wc2"
static

◆ g_szSaveSlotSignature

char g_szSaveSlotSignature[0x24]
static
Initial value:
=
"Wing Commander II (c) 1991 Origin"

Definition at line 29 of file personnel.c.

Referenced by OpenDiskDataFile(), and RunPilotSaveLoadMenu().