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

Scramble, landing and funeral scenes, and the animation demo. More...

#include <signal.h>
#include <dos.h>
#include <sys/types.h>
#include "wc1.h"
#include <memory.h>

Go to the source code of this file.

Functions

unsigned int init_3Space_objects (short scene)
short __stdcall GetShapeFrameExtent (short x, short y, struct Shape *shape, short frame, short extent)
unsigned int AnimateScrambleWalk (short ticks)
unsigned int PlayScrambleHangarScene (void)
unsigned int DrawScrambleActor (short actorIndex)
unsigned int ConfigureScrambleActor (short x, short y, short deltaX, short deltaY, struct Shape *shape, short scale, short angle, signed char flip, short actorIndex)
unsigned int DrawScrambleFrame (void)
void FlushSoundEffectsAndLog (int soundHandle, short fadeTicks)
unsigned int ReleaseMusicTrackHook (short track)
unsigned int scramble (void)
void * FetchDiskPacketRetrying (short logicalFile, short section, short flags)
unsigned int spacetrack (int track, int mode, short enabled)
void __stdcall SetEventManagerPump (void(*pump)(void))
unsigned int ReleaseTextFont (short fontIndex)
unsigned int landing (signed char damageLevel)
unsigned int funeral_player (void)
unsigned int funeral_wingman (char *text, short duration)
void FreePacketAndClear (void *slot, unsigned short releaseFlags)
unsigned int InitializeConstellationField (Viewport *viewport, short direction, short density)
void __stdcall FadeViewportPaletteToColour (Viewport *viewport, unsigned short colour, short enabled)
unsigned int SceneDirector (short sceneType, unsigned char *sceneData, unsigned char *textData)
unsigned int funeral_sequence (int playerFuneral)
unsigned int RunAnimationDemoLoop (signed char animation)

Variables

static signed char cScrambleLeftWalkerFrame = 7
static signed char cScrambleRightWalkerFrame = 10
static signed char acScrambleWalkerOverlayFrames [8]
static short nScrambleLeftWalkerX = 70
static short nScrambleRightWalkerX = 170
static short nScrambleBackgroundX = 0
static unsigned short ausScrambleActorAnimationA [8]
static unsigned short ausScrambleActorAnimationB [11]
static ScrambleAnimationActor aScrambleAnimationActors [5]
static ScrambleShipDetail aaScrambleShipDetails [4][32]
static int anLandingDamageDetailCounts [4]
static const char * apszLandingDamageComments [4]
static signed char acLandingCanopyFramesHeavy [24]
static signed char acLandingCanopyFramesLight [24]
static signed char acLandingCanopyFramesModerate [16]
static const signed char * apLandingCanopyFrames [4]
static ShortPoint aFuneralParticleOrigins [7]
static short asFuneralSceneBySeries [13]
static int bFuneralShowTheEnd = 0
short nSceneScrambleShipDetailCountValue
signed char acScrambleShipDetailSlots [24]
signed char cCutsceneScrambleWalkTime
struct Shape * pCurrentConversationSpecialShape
ShortPoint aFuneralParticlesArray [7]
struct Shape * pSceneScrambleBgShapePtr
short nFuneralParticleDistance
short nScrambleBackdropPositionY
short nScrambleBackgroundRightCoordX
ShortPoint stCutsceneFuneralForeground
short nSceneFuneralMainScale
short nFuneralRifleFrame
short nCutsceneFuneralBaseX
short nCutsceneFuneralBasePosY
ShortPoint stScramblePlayerShipPos
short nFuneralParticleScale
struct Shape * pCurrentScrambleHangarShape
struct Shape * pScrambleCockpitShapePtr
short nSceneScrambleWalkerPositionY

Detailed Description

Scramble, landing and funeral scenes, and the animation demo.

Address range 407710-40975f. The initialized scene tables precede their diagnostic and subtitle literals, which end before the following AI state.

Definition in file cutscene.c.

Function Documentation

◆ AnimateScrambleWalk()

◆ ConfigureScrambleActor()

◆ DrawScrambleActor()

◆ DrawScrambleFrame()

◆ FadeViewportPaletteToColour()

void __stdcall FadeViewportPaletteToColour ( Viewport * viewport,
unsigned short colour,
short enabled )

Definition at line 2213 of file main.c.

◆ FetchDiskPacketRetrying()

void * FetchDiskPacketRetrying ( short logicalFile,
short section,
short flags )

Definition at line 126 of file disk.c.

◆ FlushSoundEffectsAndLog()

void FlushSoundEffectsAndLog ( int soundHandle,
short fadeTicks )

Definition at line 714 of file music.c.

◆ FreePacketAndClear()

void FreePacketAndClear ( void * slot,
unsigned short releaseFlags )

Definition at line 37 of file mathutil.c.

◆ funeral_player()

◆ funeral_sequence()

unsigned int funeral_sequence ( int playerFuneral)

◆ funeral_wingman()

◆ GetShapeFrameExtent()

short __stdcall GetShapeFrameExtent ( short x,
short y,
struct Shape * shape,
short frame,
short extent )

◆ init_3Space_objects()

◆ InitializeConstellationField()

unsigned int InitializeConstellationField ( Viewport * viewport,
short direction,
short density )

Definition at line 238 of file view.c.

◆ landing()

unsigned int landing ( signed char damageLevel)

Definition at line 761 of file cutscene.c.

References acScrambleShipDetailSlots, anLandingDamageDetailCounts, apLandingCanopyFrames, apszLandingDamageComments, bEscapePressedFlag, bScrambleCanopyClosed, cBlackColour, cBlueColour, cCockpitLogicalFile, ClearViewport(), ConfigureScrambleActor(), DIBslam(), DIBslamReal(), DrawScrambleFrame(), FetchDiskPacketRetrying(), FlushSoundEffectsAndLog(), FormatTextBufferFromStart(), InitializeConversationText(), InitializeConversationViewport(), landing(), nFrameSkipCounter, nRenderedSpaceFrame, nSceneScrambleCanopyFrameValue, nSceneScrambleShipDetailCountValue, nScrambleBackdropPositionY, nScrambleBackgroundRightCoordX, nScrambleCanopyOffset, nScrambleCockpitAngle, OBJECT_TYPE_HORNET, OBJECT_TYPE_RAPIER, OBJECT_TYPE_RAPTOR, OBJECT_TYPE_SCIMITAR, CampaignState::playerShipType, PlaySfxWaveFileByNumber(), PollJoystickButtonEvents(), PreloadMusicTrackHook(), pSceneScrambleBgShapePtr, pScrambleCanopyShape, pScrambleCockpitShapePtr, pScrambleDetailShape, pScrambleOverlayShape, pScrambleShipShape, pScrambleView, PumpWindowMessages(), RandomInRange(), ReleaseMusicTrackHook(), ReleasePacketHandle(), ReleaseTextFont(), ResetScreenClipToFullHeight(), SetEventManagerPump(), spacetrack(), stCampaignState, stCurrentConvTextViewport, StopMusicUnlessSuppressed(), stSceneBuffer, stScrambleCockpitDetail, stScrambleOverlay, stScramblePlayerShipPos, WaitForSceneAdvance(), ShortPoint::x, and ShortPoint::y.

Referenced by GameFlow(), landing(), and RunAnimationDemoLoop().

◆ PlayScrambleHangarScene()

◆ ReleaseMusicTrackHook()

unsigned int ReleaseMusicTrackHook ( short track)

Definition at line 2051 of file logic.c.

◆ ReleaseTextFont()

unsigned int ReleaseTextFont ( short fontIndex)

Definition at line 222 of file disk.c.

◆ RunAnimationDemoLoop()

◆ SceneDirector()

unsigned int SceneDirector ( short sceneType,
unsigned char * sceneData,
unsigned char * textData )

Definition at line 1212 of file screens.c.

◆ scramble()

◆ SetEventManagerPump()

void __stdcall SetEventManagerPump ( void(* pump )(void))

Definition at line 126 of file strdos.c.

◆ spacetrack()

unsigned int spacetrack ( int track,
int mode,
short enabled )

Definition at line 411 of file music.c.

Variable Documentation

◆ aaScrambleShipDetails

ScrambleShipDetail aaScrambleShipDetails[4][32]
static

Definition at line 47 of file cutscene.c.

Referenced by DrawScrambleFrame().

◆ acLandingCanopyFramesHeavy

signed char acLandingCanopyFramesHeavy[24]
static
Initial value:
= {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10,
10, 10, 8, 7, 6, 5, 4, 3, 2, 1, 0, 0x40
}

Definition at line 133 of file cutscene.c.

◆ acLandingCanopyFramesLight

signed char acLandingCanopyFramesLight[24]
static
Initial value:
= {
0, 1, 2, 3, 11, 12, 13, 14, 14, 14, 14, 14,
14, 14, 13, 12, 11, 3, 2, 1, 0, 0x40, 0, 0
}

Definition at line 138 of file cutscene.c.

◆ acLandingCanopyFramesModerate

signed char acLandingCanopyFramesModerate[16]
static
Initial value:
= {
0, 15, 16, 17, 18, 19, 19, 18,
17, 16, 15, 0, 0x40, 0, 0, 0
}

Definition at line 143 of file cutscene.c.

◆ acScrambleShipDetailSlots

signed char acScrambleShipDetailSlots[24]

Definition at line 166 of file cutscene.c.

Referenced by DrawScrambleFrame(), and landing().

◆ acScrambleWalkerOverlayFrames

signed char acScrambleWalkerOverlayFrames[8]
static
Initial value:
= {
3, 4, 5, 3, 4, 6, 6, 3
}

Definition at line 21 of file cutscene.c.

Referenced by AnimateScrambleWalk().

◆ aFuneralParticleOrigins

ShortPoint aFuneralParticleOrigins[7]
static
Initial value:
= {
{ 234, 83 }, { 248, 85 }, { 260, 80 }, { 273, 78 },
{ 286, 75 }, { 299, 76 }, { 310, 74 }
}

Definition at line 155 of file cutscene.c.

Referenced by funeral_sequence().

◆ aFuneralParticlesArray

ShortPoint aFuneralParticlesArray[7]

Definition at line 169 of file cutscene.c.

Referenced by funeral_player(), and funeral_sequence().

◆ anLandingDamageDetailCounts

int anLandingDamageDetailCounts[4]
static
Initial value:
= {
0, 8, 16, 24
}

Definition at line 122 of file cutscene.c.

Referenced by landing().

◆ apLandingCanopyFrames

const signed char* apLandingCanopyFrames[4]
static
Initial value:
= {
}
static signed char acLandingCanopyFramesModerate[16]
Definition cutscene.c:143
static signed char acLandingCanopyFramesHeavy[24]
Definition cutscene.c:133
static signed char acLandingCanopyFramesLight[24]
Definition cutscene.c:138

Definition at line 148 of file cutscene.c.

Referenced by landing().

◆ apszLandingDamageComments

const char* apszLandingDamageComments[4]
static
Initial value:
= {
"You got away pretty clean, sir!",
"Looks like it got a little hot out there, sir!",
"You sure got yourself shot up, sir!",
"Glad to see you made it back alive, sir."
}

Definition at line 126 of file cutscene.c.

Referenced by landing().

◆ aScrambleAnimationActors

ScrambleAnimationActor aScrambleAnimationActors[5]
static
Initial value:
= {
{ 0, 0, 0, 0, 2, 0, 0,
{ 0, 0, 0, 0, 10, 0, 0,
{ 0, 0, 0, 0, 13, 0, 0,
{ 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0 },
{ 0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0 }
}
static unsigned short ausScrambleActorAnimationA[8]
Definition cutscene.c:28
static unsigned short ausScrambleActorAnimationB[11]
Definition cutscene.c:32

Definition at line 36 of file cutscene.c.

Referenced by ConfigureScrambleActor(), and DrawScrambleActor().

◆ asFuneralSceneBySeries

short asFuneralSceneBySeries[13]
static
Initial value:
= {
0, 1, 1, 1, 1, 1, 2, 3, 2, 3, 3, 2, 3
}

Definition at line 160 of file cutscene.c.

Referenced by funeral_sequence().

◆ ausScrambleActorAnimationA

unsigned short ausScrambleActorAnimationA[8]
static
Initial value:
= {
0, 1, 2, 3, 4, 5, 0x80, 0
}

Definition at line 28 of file cutscene.c.

◆ ausScrambleActorAnimationB

unsigned short ausScrambleActorAnimationB[11]
static
Initial value:
= {
0, 0, 1, 2, 2, 2, 2, 2, 1, 1, 0x80
}

Definition at line 32 of file cutscene.c.

◆ bFuneralShowTheEnd

int bFuneralShowTheEnd = 0
static

Definition at line 163 of file cutscene.c.

Referenced by funeral_player(), and funeral_sequence().

◆ cCutsceneScrambleWalkTime

signed char cCutsceneScrambleWalkTime

Definition at line 167 of file cutscene.c.

Referenced by PlayScrambleHangarScene().

◆ cScrambleLeftWalkerFrame

signed char cScrambleLeftWalkerFrame = 7
static

Definition at line 18 of file cutscene.c.

Referenced by AnimateScrambleWalk(), and PlayScrambleHangarScene().

◆ cScrambleRightWalkerFrame

signed char cScrambleRightWalkerFrame = 10
static

Definition at line 19 of file cutscene.c.

Referenced by AnimateScrambleWalk(), and PlayScrambleHangarScene().

◆ nCutsceneFuneralBasePosY

short nCutsceneFuneralBasePosY

Definition at line 178 of file cutscene.c.

Referenced by funeral_player(), and funeral_sequence().

◆ nCutsceneFuneralBaseX

short nCutsceneFuneralBaseX

Definition at line 177 of file cutscene.c.

Referenced by funeral_player(), and funeral_sequence().

◆ nFuneralParticleDistance

short nFuneralParticleDistance

Definition at line 171 of file cutscene.c.

Referenced by funeral_player(), and funeral_sequence().

◆ nFuneralParticleScale

short nFuneralParticleScale

Definition at line 181 of file cutscene.c.

Referenced by funeral_player().

◆ nFuneralRifleFrame

short nFuneralRifleFrame

Definition at line 176 of file cutscene.c.

Referenced by funeral_player(), and funeral_sequence().

◆ nSceneFuneralMainScale

short nSceneFuneralMainScale

Definition at line 175 of file cutscene.c.

Referenced by funeral_player().

◆ nSceneScrambleShipDetailCountValue

short nSceneScrambleShipDetailCountValue

Definition at line 165 of file cutscene.c.

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

◆ nSceneScrambleWalkerPositionY

short nSceneScrambleWalkerPositionY

Definition at line 184 of file cutscene.c.

Referenced by AnimateScrambleWalk(), and PlayScrambleHangarScene().

◆ nScrambleBackdropPositionY

short nScrambleBackdropPositionY

◆ nScrambleBackgroundRightCoordX

short nScrambleBackgroundRightCoordX

◆ nScrambleBackgroundX

short nScrambleBackgroundX = 0
static

Definition at line 26 of file cutscene.c.

Referenced by AnimateScrambleWalk(), and PlayScrambleHangarScene().

◆ nScrambleLeftWalkerX

short nScrambleLeftWalkerX = 70
static

Definition at line 24 of file cutscene.c.

Referenced by AnimateScrambleWalk(), and PlayScrambleHangarScene().

◆ nScrambleRightWalkerX

short nScrambleRightWalkerX = 170
static

Definition at line 25 of file cutscene.c.

Referenced by AnimateScrambleWalk(), and PlayScrambleHangarScene().

◆ pCurrentConversationSpecialShape

struct Shape* pCurrentConversationSpecialShape

Definition at line 168 of file cutscene.c.

Referenced by CloseTalk(), funeral_player(), and funeral_sequence().

◆ pCurrentScrambleHangarShape

struct Shape* pCurrentScrambleHangarShape

Definition at line 182 of file cutscene.c.

Referenced by AnimateScrambleWalk(), and PlayScrambleHangarScene().

◆ pSceneScrambleBgShapePtr

struct Shape* pSceneScrambleBgShapePtr

Definition at line 170 of file cutscene.c.

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

◆ pScrambleCockpitShapePtr

struct Shape* pScrambleCockpitShapePtr

Definition at line 183 of file cutscene.c.

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

◆ stCutsceneFuneralForeground

ShortPoint stCutsceneFuneralForeground

Definition at line 174 of file cutscene.c.

Referenced by funeral_player(), and funeral_sequence().

◆ stScramblePlayerShipPos

ShortPoint stScramblePlayerShipPos

Definition at line 180 of file cutscene.c.

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