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

Spaceflight setup: shapes, cockpit, constellations and music. More...

#include "game.h"

Go to the source code of this file.

Macros

#define COCKPIT_VIEW_COPY_BYTES(section)

Functions

short LoadShapeSet (PacketResourceDescriptor *resources, short flags, char *defaultFileName)
void FreeShapeSet (PacketResourceDescriptor *resources, unsigned short releaseFlags)
void initialize_cockpit (signed char mode)
int LoadPacketResourceList (PacketResourceDescriptor *resources, short flags, int availableBytes, char *defaultFileName)
void ResetCockpitPaletteEntries (void)
void ClearViewport (Viewport *viewport, short colour)
void InitializeConstellationObject (const ConstellationObjectDefinition *definition, short object)
void FreeConstellationObject (short object)
void init_constellation (short scene)
void free_constellation (void)
void init_vdus (void)
void InitializeCockpitResources (short shipType)
void free_cockpit (void)
void init_3Space_objects (short scene)
void load_common_3Space_objects (void)
void remove_all_3d_objects (void)
void free_3Space (void)
void free_3Space_objects (void)
void init_inflight_music (void)
void free_inflight_music (void)
void PreloadMusicTrack (int track)
void ReleaseMusicTrack (int track)

Variables

short g_nCockpitBackgroundBytes = 0
PacketResourceDescriptor g_aCommon3SpaceResources [11]
PacketResourceDescriptor g_aMissionResourceDescriptors [8]
PacketResourceDescriptor g_aHighMemoryCockpitResources [5]
PacketResourceDescriptor g_aCockpitCommonShapeResources [5]
PacketResourceDescriptor g_aCockpitShipShapeResources [8]
PacketResourceDescriptor g_aCockpitViewShapeResources [5]
int g_nUnusedFltsetupWord1 = 1
short g_asConstellationObjectIndices [4]
short g_bCockpitResourcesActive = 0
short g_b3SpaceObjectsActive = 0
unsigned char * g_pGenericMissileShape = 0
unsigned char * g_pGenericMissileExhaustShape = 0
char g_7_szCockpitAssetFilenameText [16]
unsigned char * g_2_apCockpitViewShapes [4]
Viewport g_stCockpitBackgroundViewportRecord
unsigned char * g_2_apCockpitShipShapes [4]
int g_nUnusedFltsetupWord2 [2]
unsigned char * g_pCockpitViewFrameInfo

Detailed Description

Spaceflight setup: shapes, cockpit, constellations and music.

Definition in file fltsetup.c.

Macro Definition Documentation

◆ COCKPIT_VIEW_COPY_BYTES

#define COCKPIT_VIEW_COPY_BYTES ( section)
Value:
((unsigned short)g_nCockpitBackgroundBytes)
short g_nCockpitBackgroundBytes
Definition fltsetup.c:1000

Definition at line 11 of file fltsetup.c.

Referenced by initialize_cockpit().

Function Documentation

◆ ClearViewport()

void ClearViewport ( Viewport * viewport,
short colour )

Definition at line 1027 of file gr.c.

◆ free_3Space()

◆ free_3Space_objects()

◆ free_cockpit()

◆ free_constellation()

◆ free_inflight_music()

◆ FreeConstellationObject()

void FreeConstellationObject ( short object)

◆ FreeShapeSet()

void FreeShapeSet ( PacketResourceDescriptor * resources,
unsigned short releaseFlags )

◆ init_3Space_objects()

◆ init_constellation()

◆ init_inflight_music()

◆ init_vdus()

◆ initialize_cockpit()

void initialize_cockpit ( signed char mode)

Definition at line 100 of file fltsetup.c.

References AllocateViewport(), Viewport::allocation, Viewport::bottom, clear_head_up_display(), ClearViewport(), COCKPIT_VIEW_COPY_BYTES, CopyViewportContents(), DosMemmove(), DrawSpriteDefault(), EndCommMenu(), explosion_draw(), FetchDiskPacketRetrying(), FinalizeTargetCameraViewHook(), free_view_buffer(), free_viewport(), g_101_stScrViewInfo, g_19_bStoredHighMemoryEnabled, g_1_cStoredViewDisplayModeValue, g_27_stViewScratchInfo, g_2_apCockpitShipShapes, g_2_apCockpitViewShapes, g_2_stModalSourceWindow, g_7_szCockpitAssetFilenameText, g_8_nGunDisplaySlot, g_9_nTargetCameraOverlayMode, g_acObjectType, g_aObjectTypeData, g_bCockpitDamageFrame0Shown, g_bSpaceViewBufferEnabled, g_cPrimaryViewBufferColour, g_cSecondaryViewBufferColour, g_nCockpitDisplayMode, g_nCurrentView, g_nScreenHeight, g_nScreenWidth, g_pCockpitBackgroundPacket, g_pCockpitViewFrameInfo, g_stCockpitBackgroundViewportRecord, IdentityDword(), initialize_cockpit(), initialize_view_buffer(), InvalidateVduMode(), Viewport::left, LoadNamedPacket(), LoadPacketIntoBuffer(), message_showing(), Viewport::pixels, ReleasePacketHandle(), reset_cockpit(), ResetCockpitPaletteEntries(), ResetPilotHandAnimation(), ResetTargetCameraView(), Viewport::right, Viewport::rowOffsets, set_up_screen_viewport(), SetViewportRect(), Viewport::top, update_VDUs(), and WaitForVerticalBlankThunk().

Referenced by close_behind(), HandleSpaceFlightControls(), initialize_cockpit(), new_view(), RunSpaceFlight(), and SetFleetOverviewView().

◆ InitializeCockpitResources()

void InitializeCockpitResources ( short shipType)

Definition at line 507 of file fltsetup.c.

References AllocateTaggedMemory(), AllocateViewport(), CockpitResourceLayout::bars, ShortRect::bottom, clear_cockpit_damage(), ClearHudGunReadouts(), CountShipCockpitGunDisplays(), CockpitResourceLayout::damagePositions, FetchDiskPacketRetrying(), CockpitResourceLayout::field_f6, CockpitResourceLayout::field_f7, free_view_buffer(), FreePacketAndClear(), g_101_stScrViewInfo, g_12_nGunDisplayCount, g_16_stCockpitTextSettingsRecord, g_19_bStoredHighMemoryEnabled, g_1_nGunShowEnergyPercent, g_1_nResourcePaletteState, g_1_pDashWeaponPicture, g_2_stLeftwardVduPortBlock, g_3_stDashViewport, g_48_apCommunicationTextPacketsTable, g_4_pScannerBlipUnderlayPointer, g_4_stRightVduView, g_66_pCabinHudImage, g_7_szCockpitAssetFilenameText, g_9_stCockpitMeterPort, g_abGunDisplayConfiguration, g_acCockpitLightOffFrame, g_acCockpitLightOnFrame, g_acObjectType, g_aCockpitBarDefinitions, g_aCockpitCommonShapeResources, g_aCockpitDamagePositions, g_aCockpitReadoutOrigins, g_aCockpitShipShapeResources, g_aCockpitViewShapeResources, g_aDefaultWeaponDisplayPositions, g_aObjectTypeData, g_apCockpitVduOverlayShapes, g_asCockpitLightX, g_asCockpitLightY, g_bCockpitResourcesActive, g_bRadioSilence, g_bTargetLockDisplayEnabled, g_cHazardBaseTravelTime, g_cSecondaryViewBufferColour, g_nCockpitBackgroundBytes, g_nCockpitExplosionFrame, g_nHazardPitchRange, g_nHudMessageBackgroundDepth, g_nObjectType62Index, g_nObjectType63Index, g_pCockpitBackgroundPacket, g_pCockpitExplosionBackground, g_pCockpitExplosionShape, g_pCockpitHudBackground, g_pDamageDisplayBackground, g_pHudMessageBackground, g_pHudMessageFrameShape, g_pPilotHandAnimationShapePtr, g_pReleaseWeaponDisplayBackground, g_stCockpitScannerGeometry, g_stHudMessageOrigin, g_stLeftVduBounds, g_stPilotHandBackgroundViewportBlock, g_stPilotHandBounds, g_stPilotHandOrigin, g_stPilotHandViewportRecord, g_stRightVduBounds, g_ucPrimaryTextColour, GetNamedPacketSize(), HasShipCockpitGunDisplay(), CockpitResourceLayout::hudMessageOrigin, init_vdus(), InitializeCockpitReadout(), InitializeCockpitResources(), InitializeTextContextFromFont(), ShortRect::left, Viewport::left, CockpitResourceLayout::leftVduBounds, CockpitResourceLayout::lightOffFrame, CockpitResourceLayout::lightOnFrame, CockpitResourceLayout::lightX, CockpitResourceLayout::lightY, LoadNamedPacket(), LoadPacketIntoBuffer(), LoadShapeSet(), MaxShort(), MeasureShapeFrameStorage(), CockpitResourceLayout::pilotHandBounds, CockpitResourceLayout::pilotHandOrigin, CockpitResourceLayout::readoutOrigins, ReportFatalErrorCode(), reset_cockpit(), ResetScannerContacts(), ShortRect::right, CockpitResourceLayout::rightVduBounds, CockpitResourceLayout::scanner, SetTextContext(), SetTextCursor(), SetViewportRect(), ObjectTypeData::shapeSet, CockpitResourceLayout::targetLockDisplayEnabled, ShortRect::top, TextContext::viewport, and CockpitResourceLayout::weaponDisplayPositions.

Referenced by close_behind(), ejection_sequence(), init_mission(), and InitializeCockpitResources().

◆ InitializeConstellationObject()

◆ load_common_3Space_objects()

◆ LoadPacketResourceList()

int LoadPacketResourceList ( PacketResourceDescriptor * resources,
short flags,
int availableBytes,
char * defaultFileName )

◆ LoadShapeSet()

◆ PreloadMusicTrack()

◆ ReleaseMusicTrack()

◆ remove_all_3d_objects()

void remove_all_3d_objects ( void )

Definition at line 881 of file fltsetup.c.

References remove_all_3d_objects(), and remove_object().

Referenced by close_behind(), init_3Space_objects(), and remove_all_3d_objects().

◆ ResetCockpitPaletteEntries()

Variable Documentation

◆ g_2_apCockpitShipShapes

unsigned char* g_2_apCockpitShipShapes[4]

Definition at line 1069 of file fltsetup.c.

Referenced by initialize_cockpit().

◆ g_2_apCockpitViewShapes

unsigned char* g_2_apCockpitViewShapes[4]

Definition at line 1067 of file fltsetup.c.

Referenced by initialize_cockpit().

◆ g_7_szCockpitAssetFilenameText

char g_7_szCockpitAssetFilenameText[16]

◆ g_aCockpitCommonShapeResources

PacketResourceDescriptor g_aCockpitCommonShapeResources[5]
Initial value:
= {
{ &g_66_pCabinHudImage, "cockpit.vga", 0 },
{ &g_18_pCockpitIndicatorShape, "cockpit.vga", 4 },
{ 0, 0, 0 }
}
unsigned char * g_4_pCockpitPanelShape
Definition message.c:236
unsigned char * g_18_pCockpitIndicatorShape
Definition message.c:229
unsigned char * g_1_pDashWeaponPicture
Definition cockpt.c:3844
unsigned char * g_66_pCabinHudImage
Definition cockpt.c:3834

Definition at line 1031 of file fltsetup.c.

Referenced by free_cockpit(), and InitializeCockpitResources().

◆ g_aCockpitShipShapeResources

PacketResourceDescriptor g_aCockpitShipShapeResources[8]
Initial value:
= {
{ &g_2_apCockpitShipShapes[0], 0, 0 },
{ &g_2_apCockpitShipShapes[1], 0, 1 },
{ &g_2_apCockpitShipShapes[2], 0, 2 },
{ &g_2_apCockpitShipShapes[3], 0, 3 },
{ 0, 0, 0 }
}
unsigned char * g_pPendingCockpitDamageShape
Definition cockpt.c:40
unsigned char * g_2_apCockpitShipShapes[4]
Definition fltsetup.c:1069

Definition at line 1038 of file fltsetup.c.

Referenced by free_cockpit(), and InitializeCockpitResources().

◆ g_aCockpitViewShapeResources

PacketResourceDescriptor g_aCockpitViewShapeResources[5]
Initial value:
= {
{ &g_2_apCockpitViewShapes[0], 0, 4 },
{ &g_2_apCockpitViewShapes[1], 0, 5 },
{ &g_2_apCockpitViewShapes[2], 0, 6 },
{ &g_2_apCockpitViewShapes[3], 0, 7 },
{ 0, 0, 0 }
}
unsigned char * g_2_apCockpitViewShapes[4]
Definition fltsetup.c:1067

Definition at line 1048 of file fltsetup.c.

Referenced by free_cockpit(), and InitializeCockpitResources().

◆ g_aCommon3SpaceResources

PacketResourceDescriptor g_aCommon3SpaceResources[11]
Initial value:
= {
{ &g_aObjectTypeData[43].shapeSet, 0, 0 },
{ &g_aObjectTypeData[36].shapeSet, 0, 1 },
{ &g_aObjectTypeData[7].shapeSet, 0, 6 },
{ &g_aObjectTypeData[9].shapeSet, 0, 7 },
{ &g_aObjectTypeData[8].shapeSet, 0, 8 },
{ &g_aObjectTypeData[39].shapeSet, 0, 9 },
{ &g_aObjectTypeData[41].shapeSet, 0, 10 },
{ &g_aObjectTypeData[40].shapeSet, 0, 11 },
{ &g_aObjectTypeData[42].shapeSet, 0, 12 },
{ &g_aObjectTypeData[10].shapeSet, 0, 18 },
{ 0, 0, 0 }
}
ObjectTypeData g_aObjectTypeData[OBJECT_DATA_COUNT]
Definition campglob.c:310
unsigned char * shapeSet
Definition game_data.h:392

Definition at line 1001 of file fltsetup.c.

Referenced by free_3Space_objects(), load_common_3Space_objects(), and LoadSpaceflightResources().

◆ g_aHighMemoryCockpitResources

PacketResourceDescriptor g_aHighMemoryCockpitResources[5]
Initial value:
= {
{ &g_66_pCabinHudImage, 0, 0 },
{ &g_pPilotHandAnimationShapePtr, "pilotanm.vga", 3 },
{ (unsigned char **)&g_pCockpitExplosionShape, 0, 5 },
{ 0, 0, 0 }
}
unsigned char * g_pPilotHandAnimationShapePtr
Definition message.c:232
unsigned char *volatile g_pCockpitExplosionShape
Definition cockpt.c:43

Definition at line 1024 of file fltsetup.c.

Referenced by LoadSpaceflightResources().

◆ g_aMissionResourceDescriptors

PacketResourceDescriptor g_aMissionResourceDescriptors[8]
Initial value:
= {
{ &g_aObjectTypeData[21].shapeSet, 0, 15 },
{ &g_aObjectTypeData[20].shapeSet, 0, 20 },
{ &g_aObjectTypeData[45].shapeSet, 0, 14 },
{ &g_aObjectTypeData[37].shapeSet, 0, 2 },
{ &g_aObjectTypeData[38].shapeSet, 0, 3 },
{ &g_aObjectTypeData[35].shapeSet, 0, 4 },
{ &g_aObjectTypeData[31].shapeSet, 0, 5 },
{ 0, 0, 0 }
}

Definition at line 1014 of file fltsetup.c.

Referenced by free_3Space(), init_mission(), and LoadSpaceflightResources().

◆ g_asConstellationObjectIndices

short g_asConstellationObjectIndices[4]
Initial value:
= {
-1, -1, -1, -1
}

Definition at line 1056 of file fltsetup.c.

Referenced by free_constellation(), and init_constellation().

◆ g_b3SpaceObjectsActive

short g_b3SpaceObjectsActive = 0

Definition at line 1060 of file fltsetup.c.

Referenced by ejection_sequence(), free_3Space(), and init_3Space_objects().

◆ g_bCockpitResourcesActive

short g_bCockpitResourcesActive = 0

◆ g_nCockpitBackgroundBytes

short g_nCockpitBackgroundBytes = 0

Definition at line 1000 of file fltsetup.c.

Referenced by InitializeCockpitResources().

◆ g_nUnusedFltsetupWord1

int g_nUnusedFltsetupWord1 = 1

Definition at line 1055 of file fltsetup.c.

◆ g_nUnusedFltsetupWord2

int g_nUnusedFltsetupWord2[2]

Definition at line 1070 of file fltsetup.c.

◆ g_pCockpitViewFrameInfo

unsigned char* g_pCockpitViewFrameInfo

Definition at line 1071 of file fltsetup.c.

Referenced by initialize_cockpit().

◆ g_pGenericMissileExhaustShape

unsigned char* g_pGenericMissileExhaustShape = 0

Definition at line 1062 of file fltsetup.c.

Referenced by free_3Space_objects(), load_common_3Space_objects(), and set_objects_data().

◆ g_pGenericMissileShape

unsigned char* g_pGenericMissileShape = 0

Definition at line 1061 of file fltsetup.c.

Referenced by free_3Space_objects(), load_common_3Space_objects(), and set_objects_data().

◆ g_stCockpitBackgroundViewportRecord

Viewport g_stCockpitBackgroundViewportRecord

Definition at line 1068 of file fltsetup.c.

Referenced by explosion_draw(), and initialize_cockpit().