UFO: Alien Invasion
Loading...
Searching...
No Matches
cl_cinematic_roq.cpp File Reference
#include "cl_cinematic_roq.h"
#include "cl_cinematic.h"
#include "../client.h"
#include "../renderer/r_draw.h"
#include "../sound/s_main.h"
#include "../sound/s_music.h"
Include dependency graph for cl_cinematic_roq.cpp:

Go to the source code of this file.

Data Structures

struct  yuvTable_t
struct  roqChunk_t
struct  roqQuadVector_t
struct  roqQuadCell_t
struct  roqCinematic_t

Macros

#define ROQ_IDENT   0x1084
#define ROQ_QUAD_INFO   0x1001
#define ROQ_QUAD_CODEBOOK   0x1002
#define ROQ_QUAD_VQ   0x1011
#define ROQ_SOUND_MONO   0x1020
#define ROQ_SOUND_STEREO   0x1021
#define ROQ_CHUNK_HEADER_SIZE   8 /* Size of a RoQ chunk header */
#define ROQ_MAX_CHUNK_SIZE   65536 /* Max size of a RoQ chunk */
#define ROQ_SOUND_RATE   22050
#define ROQ_ID_FCC   0x4000
#define ROQ_ID_SLD   0x8000
#define ROQ_ID_CCC   0xC000
#define ROQCIN   (*((roqCinematic_t*)cin->codecData))

Functions

static byte CIN_ROQ_ClampByte (int value)
 Clamps integer value into byte.
static void CIN_ROQ_ApplyVector2x2 (cinematic_t *cin, int x, int y, const byte *indices)
static void CIN_ROQ_ApplyVector4x4 (cinematic_t *cin, int x, int y, const byte *indices)
static void CIN_ROQ_ApplyMotion4x4 (cinematic_t *cin, int x, int y, int mx, int my, int mv)
static void CIN_ROQ_ApplyMotion8x8 (cinematic_t *cin, int x, int y, int mx, int my, int mv)
static void CIN_ROQ_DecodeInfo (cinematic_t *cin, const byte *data)
static void CIN_ROQ_DecodeCodeBook (cinematic_t *cin, const byte *data)
static void CIN_ROQ_DecodeVideo (cinematic_t *cin, const byte *data)
static void CIN_ROQ_DecodeSoundMono (cinematic_t *cin, const byte *data)
static void CIN_ROQ_DecodeSoundStereo (cinematic_t *cin, const byte *data)
static bool CIN_ROQ_DecodeChunk (cinematic_t *cin)
static void CIN_ROQ_DrawCinematic (cinematic_t *cin)
bool CIN_ROQ_RunCinematic (cinematic_t *cin)
void CIN_ROQ_CloseCinematic (cinematic_t *cin)
int CIN_ROQ_OpenCinematic (cinematic_t *cin, const char *fileName)
void CIN_ROQ_Init (void)

Variables

static short roqCin_sqrTable [256]
static yuvTable_t roqCin_yuvTable
static int roqCin_quadOffsets2 [2][4]
static int roqCin_quadOffsets4 [2][4]

Detailed Description

Note
This code based on the OverDose and KMQuakeII source code

Definition in file cl_cinematic_roq.cpp.

Macro Definition Documentation

◆ ROQ_CHUNK_HEADER_SIZE

#define ROQ_CHUNK_HEADER_SIZE   8 /* Size of a RoQ chunk header */

Definition at line 49 of file cl_cinematic_roq.cpp.

Referenced by CIN_ROQ_DecodeChunk(), and CIN_ROQ_OpenCinematic().

◆ ROQ_ID_CCC

#define ROQ_ID_CCC   0xC000

Definition at line 57 of file cl_cinematic_roq.cpp.

Referenced by CIN_ROQ_DecodeVideo().

◆ ROQ_ID_FCC

#define ROQ_ID_FCC   0x4000

Definition at line 55 of file cl_cinematic_roq.cpp.

Referenced by CIN_ROQ_DecodeVideo().

◆ ROQ_ID_SLD

#define ROQ_ID_SLD   0x8000

Definition at line 56 of file cl_cinematic_roq.cpp.

Referenced by CIN_ROQ_DecodeVideo().

◆ ROQ_IDENT

#define ROQ_IDENT   0x1084

Definition at line 41 of file cl_cinematic_roq.cpp.

Referenced by CIN_ROQ_DecodeChunk(), and CIN_ROQ_OpenCinematic().

◆ ROQ_MAX_CHUNK_SIZE

#define ROQ_MAX_CHUNK_SIZE   65536 /* Max size of a RoQ chunk */

◆ ROQ_QUAD_CODEBOOK

#define ROQ_QUAD_CODEBOOK   0x1002

Definition at line 44 of file cl_cinematic_roq.cpp.

Referenced by CIN_ROQ_DecodeChunk().

◆ ROQ_QUAD_INFO

#define ROQ_QUAD_INFO   0x1001

Definition at line 43 of file cl_cinematic_roq.cpp.

Referenced by CIN_ROQ_DecodeChunk().

◆ ROQ_QUAD_VQ

#define ROQ_QUAD_VQ   0x1011

Definition at line 45 of file cl_cinematic_roq.cpp.

Referenced by CIN_ROQ_DecodeChunk().

◆ ROQ_SOUND_MONO

#define ROQ_SOUND_MONO   0x1020

Definition at line 46 of file cl_cinematic_roq.cpp.

Referenced by CIN_ROQ_DecodeChunk().

◆ ROQ_SOUND_RATE

#define ROQ_SOUND_RATE   22050

Definition at line 53 of file cl_cinematic_roq.cpp.

Referenced by CIN_ROQ_DecodeSoundMono(), and CIN_ROQ_DecodeSoundStereo().

◆ ROQ_SOUND_STEREO

#define ROQ_SOUND_STEREO   0x1021

Definition at line 47 of file cl_cinematic_roq.cpp.

Referenced by CIN_ROQ_DecodeChunk().

◆ ROQCIN

Function Documentation

◆ CIN_ROQ_ApplyMotion4x4()

void CIN_ROQ_ApplyMotion4x4 ( cinematic_t * cin,
int x,
int y,
int mx,
int my,
int mv )
static
See also
CIN_ROQ_DecodeVideo

Definition at line 181 of file cl_cinematic_roq.cpp.

References i, and ROQCIN.

Referenced by CIN_ROQ_DecodeVideo().

◆ CIN_ROQ_ApplyMotion8x8()

void CIN_ROQ_ApplyMotion8x8 ( cinematic_t * cin,
int x,
int y,
int mx,
int my,
int mv )
static
See also
CIN_ROQ_DecodeVideo

Definition at line 199 of file cl_cinematic_roq.cpp.

References i, and ROQCIN.

Referenced by CIN_ROQ_DecodeVideo().

◆ CIN_ROQ_ApplyVector2x2()

void CIN_ROQ_ApplyVector2x2 ( cinematic_t * cin,
int x,
int y,
const byte * indices )
static
See also
CIN_ROQ_DecodeVideo

Definition at line 121 of file cl_cinematic_roq.cpp.

References i, ROQCIN, and roqCin_quadOffsets2.

Referenced by CIN_ROQ_DecodeVideo().

◆ CIN_ROQ_ApplyVector4x4()

void CIN_ROQ_ApplyVector4x4 ( cinematic_t * cin,
int x,
int y,
const byte * indices )
static
See also
CIN_ROQ_DecodeVideo

Definition at line 142 of file cl_cinematic_roq.cpp.

References i, ROQCIN, and roqCin_quadOffsets4.

Referenced by CIN_ROQ_DecodeVideo().

◆ CIN_ROQ_ClampByte()

byte CIN_ROQ_ClampByte ( int value)
inlinestatic

Clamps integer value into byte.

Definition at line 107 of file cl_cinematic_roq.cpp.

Referenced by CIN_ROQ_DecodeCodeBook().

◆ CIN_ROQ_CloseCinematic()

void CIN_ROQ_CloseCinematic ( cinematic_t * cin)

◆ CIN_ROQ_DecodeChunk()

◆ CIN_ROQ_DecodeCodeBook()

void CIN_ROQ_DecodeCodeBook ( cinematic_t * cin,
const byte * data )
static
See also
CIN_ROQ_DecodeChunk

Definition at line 243 of file cl_cinematic_roq.cpp.

References CIN_ROQ_ClampByte(), data, i, ROQCIN, and roqCin_yuvTable.

Referenced by CIN_ROQ_DecodeChunk().

◆ CIN_ROQ_DecodeInfo()

void CIN_ROQ_DecodeInfo ( cinematic_t * cin,
const byte * data )
static

◆ CIN_ROQ_DecodeSoundMono()

void CIN_ROQ_DecodeSoundMono ( cinematic_t * cin,
const byte * data )
static

◆ CIN_ROQ_DecodeSoundStereo()

void CIN_ROQ_DecodeSoundStereo ( cinematic_t * cin,
const byte * data )
static

◆ CIN_ROQ_DecodeVideo()

◆ CIN_ROQ_DrawCinematic()

◆ CIN_ROQ_Init()

void CIN_ROQ_Init ( void )

Definition at line 604 of file cl_cinematic_roq.cpp.

References f, i, Q_ftol, roqCin_quadOffsets2, roqCin_quadOffsets4, roqCin_sqrTable, and roqCin_yuvTable.

Referenced by CIN_Init().

◆ CIN_ROQ_OpenCinematic()

◆ CIN_ROQ_RunCinematic()

bool CIN_ROQ_RunCinematic ( cinematic_t * cin)
Returns
true if the cinematic is still running, false otherwise

Definition at line 517 of file cl_cinematic_roq.cpp.

References CIN_ROQ_DecodeChunk(), and CIN_ROQ_DrawCinematic().

Referenced by CIN_RunCinematic().

Variable Documentation

◆ roqCin_quadOffsets2

int roqCin_quadOffsets2[2][4]
static

Definition at line 99 of file cl_cinematic_roq.cpp.

Referenced by CIN_ROQ_ApplyVector2x2(), and CIN_ROQ_Init().

◆ roqCin_quadOffsets4

int roqCin_quadOffsets4[2][4]
static

Definition at line 100 of file cl_cinematic_roq.cpp.

Referenced by CIN_ROQ_ApplyVector4x4(), CIN_ROQ_DecodeVideo(), and CIN_ROQ_Init().

◆ roqCin_sqrTable

short roqCin_sqrTable[256]
static

◆ roqCin_yuvTable

yuvTable_t roqCin_yuvTable
static

Definition at line 97 of file cl_cinematic_roq.cpp.

Referenced by CIN_ROQ_DecodeCodeBook(), and CIN_ROQ_Init().