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

Scripted views, constellation effects and cockpit target rendering. More...

#include "wc1.h"
#include <sys/stat.h>
#include <sys/utime.h>

Go to the source code of this file.

Functions

unsigned int parse_view_script (void)
unsigned int update_scripted_view (void)
void initialize_scripted_view (const short *script)
unsigned int InitializeFireworks (void)
short TheEndFireWorks (Viewport *viewport, short count)
unsigned int InitializeConstellationField (Viewport *viewport, short direction, short density)
unsigned int DrawConstellationField (void)
short __stdcall OpenPacketSection (const char *filename, short section, PacketSectionHandle *handle)
void __stdcall CloseDataFileByHandle (PacketSectionHandle *handle)
void *__stdcall DecompressPacketSection (PacketSectionHandle *handle, void *destination, unsigned short flags, void *decompressionWorkspace)
short GetTargetColourIndex (void)
void DrawFormattedText (const char *format,...)
void show_target_disp (void)
void set_new_vdu (short vdu)
void DrawTargetRangeReadout (void)
void SystemDebugPrintf (const char *format,...)
void LogDisplayMode (const char *mode)
short __stdcall CalcRectangleArea (const Viewport *viewport)
unsigned short __stdcall AllocateViewport (Viewport *viewport, short clearColour, short flags)
void __stdcall AlignSpriteFrameToRectCorner (const ShortRect *rectangle, ShortPoint *position, short corner, struct Shape *shape, short frame)

Variables

short nScriptedViewObject = -1
int bScriptedView = 0
static short asConstellationVelocity [16]
static short asConstellationFrame [16]
static short nConstellationDirection = -1
const char * pszCommMenuHeading
char szCommMenuHeadingBuf [0x40]
const char * apszCommMenuChoiceTextTable [7]
int anInputButton2PressTime [2]
short asInputButton1DoubleClicksList [2]
short asInputBtn1ChangedTable [2]
short asInputButton2ChangedTable [2]
short asPreviousInputButtons [2]
int anInputButton1PressTimes [2]
static unsigned char * pPacketDecompressionWorkspace = 0
static unsigned short wPacketDecompressionInputSizeOverride = 0
static unsigned short wPacketCompressionFormatFlags = 0
static ShortRect aTargetArmorClipRects [4]

Detailed Description

Scripted views, constellation effects and cockpit target rendering.

Address range 42cdb0-42e31f. The packet and viewport helpers stay in this contiguous unit provisionally.

Definition in file view.c.

Function Documentation

◆ AlignSpriteFrameToRectCorner()

void __stdcall AlignSpriteFrameToRectCorner ( const ShortRect * rectangle,
ShortPoint * position,
short corner,
struct Shape * shape,
short frame )

◆ AllocateViewport()

◆ CalcRectangleArea()

short __stdcall CalcRectangleArea ( const Viewport * viewport)

◆ CloseDataFileByHandle()

void __stdcall CloseDataFileByHandle ( PacketSectionHandle * handle)

◆ DecompressPacketSection()

◆ DrawConstellationField()

◆ DrawFormattedText()

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

Definition at line 197 of file cockpt.c.

◆ DrawTargetRangeReadout()

◆ GetTargetColourIndex()

short GetTargetColourIndex ( void )

Definition at line 560 of file view.c.

References GetTargetColourIndex(), and nVideoMode.

Referenced by GetTargetColourIndex(), init_3Space_objects(), and LoadOriginFxDrivers().

◆ initialize_scripted_view()

◆ InitializeConstellationField()

◆ InitializeFireworks()

unsigned int InitializeFireworks ( void )

◆ LogDisplayMode()

void LogDisplayMode ( const char * mode)

◆ OpenPacketSection()

◆ parse_view_script()

◆ set_new_vdu()

void set_new_vdu ( short vdu)

Definition at line 739 of file cockpt.c.

◆ show_target_disp()

◆ SystemDebugPrintf()

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

Definition at line 182 of file pilot.cpp.

◆ TheEndFireWorks()

◆ update_scripted_view()

Variable Documentation

◆ anInputButton1PressTimes

int anInputButton1PressTimes[2]

Definition at line 33 of file view.c.

Referenced by UpdateInputDeviceTransitions().

◆ anInputButton2PressTime

int anInputButton2PressTime[2]

Definition at line 28 of file view.c.

Referenced by UpdateInputDeviceTransitions().

◆ apszCommMenuChoiceTextTable

const char* apszCommMenuChoiceTextTable[7]

Definition at line 27 of file view.c.

Referenced by AppendCommMenuChoice(), ResetCommMenuChoices(), and show_communications_disp().

◆ asConstellationFrame

short asConstellationFrame[16]
static
Initial value:
= {
0, 16, 16, 0, 4, 4, 20, 20, 24, 8, 8, 24, 28, 12, 12, 28
}

Definition at line 18 of file view.c.

Referenced by DrawConstellationField(), and InitializeConstellationField().

◆ asConstellationVelocity

short asConstellationVelocity[16]
static
Initial value:
= {
8, 8, 7, 7, 6, 6, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1
}

Definition at line 15 of file view.c.

Referenced by DrawConstellationField(), and InitializeConstellationField().

◆ asInputBtn1ChangedTable

short asInputBtn1ChangedTable[2]

◆ asInputButton1DoubleClicksList

short asInputButton1DoubleClicksList[2]

◆ asInputButton2ChangedTable

short asInputButton2ChangedTable[2]

◆ asPreviousInputButtons

short asPreviousInputButtons[2]

Definition at line 32 of file view.c.

Referenced by UpdateInputDeviceTransitions().

◆ aTargetArmorClipRects

ShortRect aTargetArmorClipRects[4]
static
Initial value:
= {
{ 12, -20, 29, 20 },
{ -11, 1, 11, 20 },
{ -11, -20, 11, 0 },
{ -29, -20, -12, 20 }
}

Definition at line 363 of file view.c.

Referenced by show_target_disp().

◆ bScriptedView

◆ nConstellationDirection

short nConstellationDirection = -1
static

Definition at line 21 of file view.c.

Referenced by DrawConstellationField(), and InitializeConstellationField().

◆ nScriptedViewObject

short nScriptedViewObject = -1

◆ pPacketDecompressionWorkspace

unsigned char* pPacketDecompressionWorkspace = 0
static

Definition at line 359 of file view.c.

Referenced by DecompressPacketSection().

◆ pszCommMenuHeading

const char* pszCommMenuHeading

Definition at line 25 of file view.c.

Referenced by OpenCommMenuForTarget(), and show_communications_disp().

◆ szCommMenuHeadingBuf

char szCommMenuHeadingBuf[0x40]

Definition at line 26 of file view.c.

Referenced by BuildCommunicationCommandMenu().

◆ wPacketCompressionFormatFlags

unsigned short wPacketCompressionFormatFlags = 0
static

Definition at line 361 of file view.c.

Referenced by DecompressPacketSection().

◆ wPacketDecompressionInputSizeOverride

unsigned short wPacketDecompressionInputSizeOverride = 0
static

Definition at line 360 of file view.c.

Referenced by DecompressPacketSection().