61 "Further objectives out-system.";
70 const char *format, ...)
76 va_start(arguments, format);
83 (
unsigned long *)arguments);
110void nav_getxy(
short *x,
short *y,
int worldX,
int worldZ)
112 *x = (short)((worldX / 100) >> 8);
113 *y = (short)((worldZ / 100) >> 8);
144 short objectiveIndex;
154 for (objectiveIndex = 0;
183 (
short)((mapWidth / 2 + mapWidth) / 150),
184 (
short)((mapHeight / 2 + mapHeight) / 135));
199 short flightPathCount;
207 while ((type = record->
type) != -1 &&
248 location.
x, location.
z);
277 return x > 0 && y > 0 && x + width < 150 && y + height < 135;
284 short width,
short height)
297 for (checkX = x; checkX < x + width && clear != 0;
299 for (checkY = y; checkY < y + height && clear != 0;
302 rect, checkX, checkY) == 0);
351#pragma function(strlen)
359 textWidth = (short)(strlen(text) * 4 + 2);
368 textWidth, 0) == 0 &&
370 (
short)(shift + y + 5), textWidth,
371 (
short)(shift == 12)) == 0 &&
373 textWidth, (
short)(shift == 12)) == 0 &&
375 (
short)(shift == 12)) == 0 &&
377 (
short)(y - 9 - shift), textWidth,
378 (
short)(shift == 12)) == 0 &&
420 unsigned short colour,
const char *text,
421 short objective,
short missionShip)
425 if (missionShip == -1) {
429 for (previous = 0; previous < objective; previous++) {
437 if (previous >= objective)
452#pragma intrinsic(strlen)
473 unsigned short colour,
short reserve)
477 x, y, size, (
short)((size * 7) / 8),
482 x, y, size, (
short)((size * 7) / 8), (
short)colour);
483 if (reserve != 0 && size < 5)
485 (
short)(size * 2 + 1),
486 (
short)(size * 2 + 1));
495 short size,
signed char colour)
498 (
short)(x + size), (
short)(y + size),
504 short colour,
short reserve)
510 (
short)(x + 1), y, colour);
512 x, (
short)(y + 1), colour);
515 (
short)(y + 1), colour);
519 (
signed char)colour);
521 if (reserve != 0 && size < 5)
523 (
short)(size * 2 + 1),
524 (
short)(size * 2 + 1));
532 short size,
signed char colour)
535 (
short)(x + size), (
short)(y + size), colour);
537 (
short)(x - size), (
short)(y + size), colour);
539 x, (
short)(y - size), colour);
544 unsigned short colour,
short reserve)
548 (
signed char)colour);
549 if (reserve != 0 && size < 5)
551 (
short)(size * 2 + 1),
552 (
short)(size * 2 + 1));
561 unsigned short colour,
short reserve)
564 (
short)(x - size), (
short)(y - size),
565 (
short)(x + size), (
short)(y + size),
568 (
short)(x - size), (
short)(y + size),
569 (
short)(x + size), (
short)(y - size),
571 if (reserve != 0 && size < 5)
573 (
short)(size * 2 + 1),
574 (
short)(size * 2 + 1));
608 unsigned short c,
unsigned short d)
615 short size,
unsigned short markerColour,
616 unsigned short textColour,
const char *text)
655 while (beaconRecord->
active != 0) {
665 beaconRecord->
name, 0, -1);
673 unsigned short nameColour;
699 for (checkpoint = 0; checkpoint < 10; checkpoint++) {
703 for (index = 0; index < 10; index++) {
738 index].index].state == 0 &&
784 if (showPlayer != 0 &&
810 sprintf(time,
"%02d",
813 "%X%YStandard time %s",
818 if (showColon == 0) {
824 sprintf(time,
"%02d ",
835 unsigned char tmp[4];
887 char fileName[11] =
"sector.000";
909 length = (short)filelength(file);
930 .playerMissionShip].missionType]);
936 if (showFlightData != 0)
939 if (showFlightData != 0) {
943 "%X%Y Location: %d.%d.%d",
981 for (font = 0; font < 4; font++) {
997 short objectiveFound;
1004 mouseX = (short)(mouseX - 30);
1005 mouseY = (short)(mouseY - 22);
1017 distance = (short)(abs((
int)mouseY - mapY) +
1018 abs((
int)mouseX - mapX));
1022 mouseX, mouseY) != 0) {
1025 if (previousNav == step)
1026 return objectiveFound;
1031 return objectiveFound;
1048 x = (short)(x + 30);
1049 y = (short)(y + 22);
1101 unsigned char *cockpitShape;
1106 short objectivesVisible;
1112 objectivesVisible = 0;
1138 objectivesVisible = 1;
1144 if (objectivesVisible == 0) {
1193 if (inputEvent.
status != 0x1c &&
1194 inputEvent.
status != 0x39) {
1195 if (inputEvent.
status == 0x31) {
1218 (
signed char)savedNav;
void(__cdecl *g_pIxFree)(void *)
void DrawNavSquareOutline(Viewport *viewport, short x, short y, short size, signed char colour)
short find_ships_sphere(short missionShip)
void Build_objective_list(void)
int ConfigureInputPump(int slot, void(*pump)(void))
void SetInputViewport(Viewport *viewport)
void DrawViewportLine(Viewport *viewport, short x1, short y1, short x2, short y2, short colour)
void DrawViewportEllipseShadow(Viewport *viewport, short x, short y, short verticalRadius, short horizontalRadius, short colour)
void SetRectBounds(Viewport *viewport, unsigned short left, unsigned short top, unsigned short right, unsigned short bottom)
void PollJoystickButtonEvents(void)
short MaxShort(short a, short b)
void CheckPoint(short x, short y)
void SplitGameClockTicksForNav(unsigned char *parts)
void InitializeTextContextFromFont(TextContext *context, short fontIndex, unsigned char colour, signed char background)
short LocateMobileObjective(short objective)
short ObjectivesShareNavLabel(short objective, short other)
void DrawNavHazardMarker(FixedVector navPosition, FixedVector offset, short size, unsigned short markerColour, unsigned short textColour, const char *text)
short AllocateViewport(Viewport *viewport, short clearColour, short flags)
short NavMapPointInsideReservedArea(short area, short x, short y)
void DrawNavTextLine(unsigned char alignment, unsigned short colour, const char *format,...)
short NavMapLabelPositionAvailable(short x, short y, short width, short height)
void ShowConfedNavScan(short refresh)
void AddFixedVectors(const FixedVector *left, const FixedVector *right, FixedVector *sum)
void InitializeSpaceFlightInput(void)
void free_viewport(Viewport *viewport)
void DrawViewportPixel(Viewport *viewport, short x, short y, short colour)
void DrawNavMapLegend(void)
void SetTextContext(TextContext *context)
short IsPointInNavMapLabel(short label, short x, short y)
void get_player_input(void)
void SetNavMapCoordinateScaling(short enabled)
int ReadDataFileAtOffset(unsigned short fd, int offset, unsigned int length, void *data)
void DrawNavTriangleOutline(Viewport *viewport, short x, short y, short size, signed char colour)
void DrawSpriteDefault(Viewport *viewport, short x, short y, unsigned char *shape, short frame)
int PollInputEvent(InputEventState *event, short)
short MinShort(short a, short b)
void FollowSelectedObjectiveSystem(void)
const char * objective_name(short objective)
void ReserveNavMapArea(short x, short y, short width, short height)
void BuildMap(short showPlayer)
void DrawNavMapLabels(void)
void DrawNavTriangleMarker(short x, short y, short size, short shadow, unsigned short colour, short reserve)
void * AllocateTaggedMemory(unsigned int size, short flags)
void DrawTextString(const char *text)
short NavMapLabelFits(short x, short y, short width, short height)
short visited(short objective)
short achieved(short objective)
void * FetchDiskPacketRetrying(char *fileName, short section, short flags)
void ResetNavMapReservedAreas(void)
void ResetNavMapLabels(void)
void ReleasePacketSlot(void **slot)
void force_view(int view, short obj)
char * nav_note(short objective)
void BriefingMap_LoadShapes(void)
short SelectNavObjectiveAtPoint(short mouseX, short mouseY)
void FormatTextTokens(void(*writer)(int), const char *format, va_list arguments)
short TryPlaceNavMapLabel(short x, short y, short width, short force)
void InflightComputer(void)
void CentreMouseOnCurrentNavObjective(void)
void DrawNavLocationReadout(const char *title, short showFlightData)
void DisableMouseCursorDrawing(void)
void SetScreenClipRect(unsigned short a, unsigned short b, unsigned short c, unsigned short d)
short OpenDataFileOrDie(const char *path)
void ReportOutOfMemoryAndExit(const char *resource)
void PlaceNavMapLabel(short x, short y, unsigned short colour, const char *text)
void DrawNavCrossMarker(short x, short y, short size, short shadow, unsigned short colour, short reserve)
void DrawNavSquareMarker(short x, short y, short size, short shadow, short colour, short reserve)
void DrawViewportEllipse(Viewport *viewport, short x, short y, short verticalRadius, short horizontalRadius, short colour)
void DrawViewportBorder(Viewport *viewport, short left, short top, short right, short bottom, short colour)
void DrawSelectedNavLegendEntry(const char *text, short navPoint)
void ClearViewport(Viewport *viewport, short colour)
void AddUniqueObjectiveNavLabel(short x, short y, unsigned short colour, const char *text, short objective, short missionShip)
void EnableMouseCursorDrawing(void)
void AppendTextCharacter(char character)
void SetPersonnelMousePosition(short x, short y)
void PlaySfxWaveFileByNumber(int soundNumber, int sourceObject, int looping)
short hidden_objective(short objective)
void nav_getxy(short *x, short *y, int worldX, int worldZ)
void FormatNavCoordinates(unsigned char *out)
void SetMenuInputPump(void)
short IsObjectiveInDisplayedSystem(short objective)
void ReleasePacketHandle(void *handle)
void ScaleNavMapCoordinates(short *x, short *y, short mapX, short mapY)
void BriefingMap_DisplayMap(void)
short mobile_objective(short objective)
void RefreshObjectiveShipNavPoints(void)
void SetTextCursor(unsigned short a, unsigned short b)
unsigned short WaitForAnyInputPress(void)
short set_new_objective(short pathIndex)
void free_view_buffer(void)
void ScaleNavMapMarkerSize(short *size)
short find_ship_index(short missionShip)
void set_sphere_point(const MissionShipRecord *record, FixedVector *position)
void DrawNavMapBriefingBeacons(void)
void IncludeNavMapWorldPoint(int worldX, int worldZ)
void SetFrameTimerAndWait(short period)
void DrawFormattedText(const char *format,...)
void DrawNavRectangleMarker(short x, short y, short size, short shadow, unsigned short colour, short reserve)
void CopyViewportContents(Viewport *source, Viewport *destination)
void UpdateInflightNavText(short showColon)
short cycle_next_objective(void)
void SetMouseCursorShape(unsigned char *shape, short frame)
short message_showing(void)
void DrawNavPlayerMarker(short colour, short reserve)
Shared Win32 declarations, types and library interfaces.
HostMouseMessage g_6_stHostMouseTextBlock
unsigned char * g_pNavMapShape
short g_nCurStellarSystem
unsigned char * g_pNavLocationText
short g_bBriefingMapActive
signed char g_bSceneEscapeRequested
signed char g_abFlightPath[MISSION_OBJECTIVE_COUNT]
short g_nNavMapReservedAreaCount
NAV_STATIC NavMapLabel g_1_aNavMapLabels[20]
unsigned char g_abMissionBriefingData[0xde]
signed char g_cCurrentObjective
unsigned short g_awNavObjectiveLabelIndex[8]
unsigned char g_cYellowColour
InputManagerState * g_18_pEventManager
MissionNavPoint g_aMissionNavPoints[MISSION_NAV_POINT_COUNT]
char * g_apszShipMissionTypeNames[14]
signed char g_cMissionObjectiveCount
MouseCursorState g_37_stPersonnelMousePointerState
TextContext * g_29_pCurrentTextContext
short g_nSelectedCampaignSlot
char g_6_szDefaultTextBufferText[0xc8]
TextContext g_stNavMapTextCtx
unsigned char g_26_bMouseCursorEnabled
MissionObjectiveSource g_69_aMissionObjectiveSources[8]
unsigned char g_cSecondaryViewBufferColour
short g_2_nNavMapMinimumYValue
unsigned char g_ucHomeCarrierScannerColour
short g_nNavmapMapMinimumX
unsigned char g_88_nEventRepeatDelayState
short g_nNavMapCoordinateScaling
unsigned char g_cRedColour
unsigned char g_ucAsteroidNavMarkerColour
unsigned char g_ucPrimaryTextColour
CampaignDate * g_4_pElapsedCampaignDatePointer
unsigned char g_bPrimaryViewBufferColour
signed char g_cCurrentNavPointIndex
volatile int g_196_nInputTimerTicks
FixedVector g_aShipPosition[SPACE_OBJECT_COUNT]
unsigned char g_ucDefaultTextColour
NAV_STATIC ShortRect g_aNavMapExclusionRects[20]
unsigned char g_ucNavObjectiveMarkerColour
Viewport g_101_stScrViewInfo
signed char g_1_cStoredViewDisplayModeValue
short g_nNavmapMapMaximumY
int g_bInflightComputerActive
MissionObjective g_aMissionObjectives[MISSION_OBJECTIVE_COUNT]
Viewport g_stSecondaryViewBufferBlock
CampaignDate g_1_stElapsedCampaignDate
MissionShipRecord g_aMissionShips[MISSION_SHIP_COUNT]
short g_nNavMapLabelCount
PilotProfile g_stCurrentPilotProfile
short g_18_nInterfaceEventMode
unsigned short g_wDigiLeft
unsigned char g_abSeriesAuxData[0x28]
TextContext g_3_stDefaultStringContext
unsigned char * g_36_apTextGlyphs[4]
unsigned char g_5_abMissionAuxBlockBytes[0x28]
TextContext g_5_stNavLabelTextContextInfo
short g_13_nNavmapMapCentreX
MissionHeader g_13_stMissionHeaderBlock
NavMapObjectiveStyle g_aNavMapObjectiveStyles[12]
unsigned char g_ucPlayerNavLabelColour
char g_szNoFurtherObjectives[32]
unsigned char * labelColour
unsigned char * unvisitedColour
unsigned char * markerColour