UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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"

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. More...
 
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

#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().

#define ROQ_ID_CCC   0xC000

Definition at line 57 of file cl_cinematic_roq.cpp.

Referenced by CIN_ROQ_DecodeVideo().

#define ROQ_ID_FCC   0x4000

Definition at line 55 of file cl_cinematic_roq.cpp.

Referenced by CIN_ROQ_DecodeVideo().

#define ROQ_ID_SLD   0x8000

Definition at line 56 of file cl_cinematic_roq.cpp.

Referenced by CIN_ROQ_DecodeVideo().

#define ROQ_IDENT   0x1084

Definition at line 41 of file cl_cinematic_roq.cpp.

Referenced by CIN_ROQ_DecodeChunk(), and CIN_ROQ_OpenCinematic().

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

Definition at line 44 of file cl_cinematic_roq.cpp.

Referenced by CIN_ROQ_DecodeChunk().

#define ROQ_QUAD_INFO   0x1001

Definition at line 43 of file cl_cinematic_roq.cpp.

Referenced by CIN_ROQ_DecodeChunk().

#define ROQ_QUAD_VQ   0x1011

Definition at line 45 of file cl_cinematic_roq.cpp.

Referenced by CIN_ROQ_DecodeChunk().

#define ROQ_SOUND_MONO   0x1020

Definition at line 46 of file cl_cinematic_roq.cpp.

Referenced by CIN_ROQ_DecodeChunk().

#define ROQ_SOUND_RATE   22050

Definition at line 53 of file cl_cinematic_roq.cpp.

Referenced by CIN_ROQ_DecodeSoundMono(), and CIN_ROQ_DecodeSoundStereo().

#define ROQ_SOUND_STEREO   0x1021

Definition at line 47 of file cl_cinematic_roq.cpp.

Referenced by CIN_ROQ_DecodeChunk().

Function Documentation

static 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().

static 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().

static 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().

static 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().

static 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().

void CIN_ROQ_CloseCinematic ( cinematic_t cin)
static void CIN_ROQ_DecodeCodeBook ( cinematic_t cin,
const byte data 
)
static
static void CIN_ROQ_DecodeInfo ( cinematic_t cin,
const byte data 
)
static
static void CIN_ROQ_DecodeSoundMono ( cinematic_t cin,
const byte data 
)
static
static void CIN_ROQ_DecodeSoundStereo ( cinematic_t cin,
const byte data 
)
static
static void CIN_ROQ_DrawCinematic ( cinematic_t cin)
static
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

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().

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().

short roqCin_sqrTable[256]
static
yuvTable_t roqCin_yuvTable
static

Definition at line 97 of file cl_cinematic_roq.cpp.