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

Mission setup, ship resources, formation placement and pilot speech. More...

#include <process.h>
#include <crtdbg.h>
#include "wc1.h"

Go to the source code of this file.

Functions

void set_sphere_point (const MissionShipRecord *record, FixedVector *position)
unsigned int is_alive (int pilot)
unsigned int check_futurion (short i)
unsigned int init_mission (short series, short mission)
void prepare_mission (void)
int release_all_capital_ship_shapes (void)
int release_capital_ship_shapes (enum ObjectType type)
int load_ship (enum ObjectType type, short slot)
int free_ship (short slot)
int free_all_slots (void)
int load_all_slots (void)
void remove_nav_point_objects (void)
short get_shape_slot (void)
int shape_loaded (enum ObjectType type)
int shape_needed (const MissionNavPoint *navPoint, enum ObjectType type)
int new_sphere_shapes (MissionNavPoint *navPoint)
int set_up_action_sphere (short navPoint)
void free_pilot_talk (short personality)
void FreeAllPilotTalk (void)
void get_pilot_talk (short personality)
unsigned int init_personalities (void)
unsigned int room_for_me (short obj, short minimum)
void approve_xyz (short obj, short minimum, short maximum)
void set_up_next_wave (void)
unsigned int sub_int_vector (const ShortVector *left, const ShortVector *right, ShortVector *difference)
unsigned int set_formation_position (short obj, const MissionShipRecord *record)
unsigned int Set_up_ship_info (short obj, short missionShip, signed char navPoint)
unsigned int is_team_member (short missionShip)
void AddFixedVectors (const FixedVector *left, const FixedVector *right, FixedVector *sum)
short initialize_ship (enum ObjectType type, short owner)
unsigned int find_next_ship_turn_slot (short obj)
short init_ship (short missionShip, short navPoint)
unsigned int init_intelligence_data (short obj)
short __stdcall SampleBothJoysticks (InputDeviceSample *samples, short fallback)
int __stdcall SampleJoystickDevice (InputDeviceSample *samples, short joystick, unsigned short fallback)
short ReadJoystickButtons (void)
void SampleActiveJoystickDevice (void)
void DrawNavTextLine (unsigned char alignment, unsigned short colour, const char *format,...)
void SetNavMapCoordinateScaling (short enabled)
void ScaleNavMapMarkerSize (short *size)
void ScaleNavMapCoordinates (short *x, short *y, short mapX, short mapY)
void nav_getxy (short *x, short *y, int worldX, int worldZ)
short MinShort (short a, short b)
short MaxShort (short a, short b,...)
short find_ship_index (short missionShip)
short mobile_objective (short objective)
int set_new_objective (short pathIndex)
void CheckPoint (short x, short y)
void IncludeNavMapWorldPoint (int worldX, int worldZ)
void SetScale (void)
void Build_objective_list (void)

Variables

short nDebriefingPersonality = 0
static int bInitialFormationSetup = 0
void * aapPacketReferences [4][0x25] = {0}
static ShortVector aaFormationPositions [5][8]
static int anPilotTurnInterval [18]
unsigned char abSeriesAuxData [0x28]
MissionObjectiveSource aMissionObjectiveSources [16]
MissionHeaderDisk stCurrentMissionHeader
CampaignDate * pCurrentCampaignDate
CampaignDate * pElapsedCampaignDatePtr
signed char cCurrentObjResourceLogicalFile
Viewport * pScrambleView
short nSceneScrambleCanopyFrameValue

Detailed Description

Mission setup, ship resources, formation placement and pilot speech.

Address range 40b670-40d08f. The joystick and navigation-map helpers at its end stay here provisionally: where their original object began is unresolved.

Definition in file mission.c.

Function Documentation

◆ AddFixedVectors()

void AddFixedVectors ( const FixedVector * left,
const FixedVector * right,
FixedVector * sum )

Definition at line 296 of file geom.c.

◆ approve_xyz()

void approve_xyz ( short obj,
short minimum,
short maximum )

◆ Build_objective_list()

◆ check_futurion()

unsigned int check_futurion ( short i)

◆ CheckPoint()

◆ DrawNavTextLine()

void DrawNavTextLine ( unsigned char alignment,
unsigned short colour,
const char * format,
... )

◆ find_next_ship_turn_slot()

unsigned int find_next_ship_turn_slot ( short obj)

◆ find_ship_index()

short find_ship_index ( short missionShip)

Definition at line 439 of file logic.c.

◆ free_all_slots()

◆ free_pilot_talk()

void free_pilot_talk ( short personality)

◆ free_ship()

◆ FreeAllPilotTalk()

void FreeAllPilotTalk ( void )

Definition at line 600 of file mission.c.

References free_pilot_talk(), and FreeAllPilotTalk().

Referenced by FreeAllPilotTalk().

◆ get_pilot_talk()

◆ get_shape_slot()

short get_shape_slot ( void )

Definition at line 443 of file mission.c.

References aObjectResourceSlotsArray, and get_shape_slot().

Referenced by get_shape_slot(), and new_sphere_shapes().

◆ IncludeNavMapWorldPoint()

void IncludeNavMapWorldPoint ( int worldX,
int worldZ )

Definition at line 1071 of file mission.c.

References CheckPoint(), IncludeNavMapWorldPoint(), and nav_getxy().

Referenced by IncludeNavMapWorldPoint(), and SetScale().

◆ init_intelligence_data()

◆ init_mission()

◆ init_personalities()

◆ init_ship()

◆ initialize_ship()

short initialize_ship ( enum ObjectType type,
short owner )

Definition at line 102 of file ship.c.

◆ is_alive()

unsigned int is_alive ( int pilot)

◆ is_team_member()

unsigned int is_team_member ( short missionShip)

◆ load_all_slots()

◆ load_ship()

◆ MaxShort()

short MaxShort ( short a,
short b,
... )

Definition at line 29 of file mathutil.c.

◆ MinShort()

short MinShort ( short a,
short b )

Definition at line 20 of file mathutil.c.

◆ mobile_objective()

short mobile_objective ( short objective)

Definition at line 1433 of file cockpt.c.

◆ nav_getxy()

void nav_getxy ( short * x,
short * y,
int worldX,
int worldZ )

◆ new_sphere_shapes()

◆ prepare_mission()

◆ ReadJoystickButtons()

short ReadJoystickButtons ( void )

Definition at line 982 of file mission.c.

References GetJoystickButtons(), and ReadJoystickButtons().

Referenced by ReadJoystickButtons().

◆ release_all_capital_ship_shapes()

◆ release_capital_ship_shapes()

◆ remove_nav_point_objects()

void remove_nav_point_objects ( void )

Definition at line 432 of file mission.c.

References remove_nav_point_objects(), and remove_object().

Referenced by remove_nav_point_objects(), and ShowCarrierLaunchSequence().

◆ room_for_me()

unsigned int room_for_me ( short obj,
short minimum )

Definition at line 670 of file mission.c.

References room_for_me().

Referenced by approve_xyz(), and room_for_me().

◆ SampleActiveJoystickDevice()

void SampleActiveJoystickDevice ( void )

◆ SampleBothJoysticks()

short __stdcall SampleBothJoysticks ( InputDeviceSample * samples,
short fallback )

Definition at line 945 of file mission.c.

References GetJoystickPosition(), and SampleBothJoysticks().

Referenced by LoadJoystickCalibrationFile(), and SampleBothJoysticks().

◆ SampleJoystickDevice()

◆ ScaleNavMapCoordinates()

void ScaleNavMapCoordinates ( short * x,
short * y,
short mapX,
short mapY )

◆ ScaleNavMapMarkerSize()

void ScaleNavMapMarkerSize ( short * size)

Definition at line 1024 of file mission.c.

References nNavMapScale, and ScaleNavMapMarkerSize().

Referenced by DrawNavHazardMarker(), and ScaleNavMapMarkerSize().

◆ set_formation_position()

◆ set_new_objective()

int set_new_objective ( short pathIndex)

Definition at line 1131 of file cockpt.c.

◆ set_sphere_point()

◆ set_up_action_sphere()

◆ set_up_next_wave()

◆ Set_up_ship_info()

◆ SetNavMapCoordinateScaling()

void SetNavMapCoordinateScaling ( short enabled)

◆ SetScale()

◆ shape_loaded()

int shape_loaded ( enum ObjectType type)

Definition at line 456 of file mission.c.

References aObjectResourceSlotsArray, and shape_loaded().

Referenced by new_sphere_shapes(), and shape_loaded().

◆ shape_needed()

int shape_needed ( const MissionNavPoint * navPoint,
enum ObjectType type )

Definition at line 470 of file mission.c.

References MissionNavPoint::preloadObjectTypes, and shape_needed().

Referenced by new_sphere_shapes(), and shape_needed().

◆ sub_int_vector()

unsigned int sub_int_vector ( const ShortVector * left,
const ShortVector * right,
ShortVector * difference )

Definition at line 722 of file mission.c.

References sub_int_vector(), ShortVector::x, ShortVector::y, and ShortVector::z.

Referenced by set_formation_position(), and sub_int_vector().

Variable Documentation

◆ aaFormationPositions

ShortVector aaFormationPositions[5][8]
static
Initial value:
= {
{
{ 0, 0, 0 }, { -750, 0, 0 }, { 750, 0, 0 }, { 0, 0, -750 },
{ 0, 0, 750 }, { -750, 0, -750 }, { 750, 0, -750 },
{ 0, 0, -1500 }
},
{
{ 0, 0, 0 }, { 750, 0, 0 }, { -750, -100, -250 },
{ 1500, -100, -250 }, { -1500, -200, -500 },
{ -2250, -300, -750 }, { 2250, -200, -500 },
{ 3000, -300, -750 }
},
{
{ 0, 0, 0 }, { 750, 0, -500 }, { -750, 0, -500 },
{ 0, 0, -1000 }, { -1500, 0, -1000 }, { -750, 0, -1500 },
{ 1500, 0, -1000 }, { 750, 0, -1500 }
},
{
{ 0, 0, 0 }, { 750, 0, -250 }, { 0, 325, -500 },
{ 750, -325, -750 }, { 0, 325, -500 }, { 750, -325, -750 },
{ 0, 0, -1000 }, { 750, 0, -1250 }
},
{
{ 0, 0, 0 }, { 0, 0, -750 }, { -750, 0, -500 },
{ -750, 0, -1250 }, { 750, 0, -500 }, { 750, 0, -1250 },
{ 0, 500, -500 }, { 0, 500, -1250 }
}
}

Definition at line 20 of file mission.c.

Referenced by set_formation_position().

◆ aapPacketReferences

void* aapPacketReferences[4][0x25] = {0}

Definition at line 17 of file mission.c.

Referenced by free_ship(), get_right_shape(), load_ship(), and ReleasePacketHandle().

◆ abSeriesAuxData

unsigned char abSeriesAuxData[0x28]

Definition at line 55 of file mission.c.

Referenced by AddPCName(), DrawNavLocationReadout(), and LoadMissionData().

◆ aMissionObjectiveSources

MissionObjectiveSource aMissionObjectiveSources[16]

Definition at line 56 of file mission.c.

Referenced by Build_objective_list(), and LoadMissionData().

◆ anPilotTurnInterval

int anPilotTurnInterval[18]
static
Initial value:
= {
5, 5, 4, 4, 3, 3, 3, 2, 2, 1, 3, 3, 3, 3, 2, 2, 2, 1
}

Definition at line 50 of file mission.c.

Referenced by find_next_ship_turn_slot().

◆ bInitialFormationSetup

int bInitialFormationSetup = 0
static

Definition at line 16 of file mission.c.

Referenced by prepare_mission(), and set_formation_position().

◆ cCurrentObjResourceLogicalFile

signed char cCurrentObjResourceLogicalFile

Definition at line 60 of file mission.c.

Referenced by load_ship(), and LoadTrainSimOpponentShape().

◆ nDebriefingPersonality

short nDebriefingPersonality = 0

Definition at line 14 of file mission.c.

Referenced by DrawDebriefingLongShot(), and GameFlow().

◆ nSceneScrambleCanopyFrameValue

short nSceneScrambleCanopyFrameValue

Definition at line 62 of file mission.c.

Referenced by DrawScrambleFrame(), landing(), and scramble().

◆ pCurrentCampaignDate

CampaignDate* pCurrentCampaignDate

Definition at line 58 of file mission.c.

Referenced by AddPCName(), CorrectPointers(), MoveNewCampaign(), ShowChalkBoard(), and UpdateSeries().

◆ pElapsedCampaignDatePtr

CampaignDate* pElapsedCampaignDatePtr

Definition at line 59 of file mission.c.

Referenced by AddPCName(), CorrectPointers(), InflightComputer(), and UpdateInflightNavText().

◆ pScrambleView

Viewport* pScrambleView

Definition at line 61 of file mission.c.

Referenced by DrawScrambleActor(), landing(), scramble(), and ShowCarrierLaunchSequence().

◆ stCurrentMissionHeader