#include "cl_cinematic_roq.h"
#include "cl_cinematic.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 |
Defines | |
#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 |
#define | ROQ_MAX_CHUNK_SIZE 65536 |
#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 qboolean | CIN_ROQ_DecodeChunk (cinematic_t *cin) |
static void | CIN_ROQ_DrawCinematic (cinematic_t *cin) |
qboolean | CIN_ROQ_RunCinematic (cinematic_t *cin) |
void | CIN_ROQ_StopCinematic (cinematic_t *cin) |
void | CIN_ROQ_PlayCinematic (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] |
Definition in file cl_cinematic_roq.c.
#define ROQ_CHUNK_HEADER_SIZE 8 |
Definition at line 48 of file cl_cinematic_roq.c.
Referenced by CIN_ROQ_DecodeChunk(), and CIN_ROQ_PlayCinematic().
#define ROQ_ID_CCC 0xC000 |
Definition at line 56 of file cl_cinematic_roq.c.
Referenced by CIN_ROQ_DecodeVideo().
#define ROQ_ID_FCC 0x4000 |
Definition at line 54 of file cl_cinematic_roq.c.
Referenced by CIN_ROQ_DecodeVideo().
#define ROQ_ID_SLD 0x8000 |
Definition at line 55 of file cl_cinematic_roq.c.
Referenced by CIN_ROQ_DecodeVideo().
#define ROQ_IDENT 0x1084 |
Definition at line 40 of file cl_cinematic_roq.c.
Referenced by CIN_ROQ_DecodeChunk(), and CIN_ROQ_PlayCinematic().
#define ROQ_MAX_CHUNK_SIZE 65536 |
Definition at line 50 of file cl_cinematic_roq.c.
Referenced by CIN_ROQ_DecodeChunk(), CIN_ROQ_DecodeSoundMono(), and CIN_ROQ_DecodeSoundStereo().
#define ROQ_QUAD_CODEBOOK 0x1002 |
Definition at line 43 of file cl_cinematic_roq.c.
Referenced by CIN_ROQ_DecodeChunk().
#define ROQ_QUAD_INFO 0x1001 |
Definition at line 42 of file cl_cinematic_roq.c.
Referenced by CIN_ROQ_DecodeChunk().
#define ROQ_QUAD_VQ 0x1011 |
Definition at line 44 of file cl_cinematic_roq.c.
Referenced by CIN_ROQ_DecodeChunk().
#define ROQ_SOUND_MONO 0x1020 |
Definition at line 45 of file cl_cinematic_roq.c.
Referenced by CIN_ROQ_DecodeChunk().
#define ROQ_SOUND_RATE 22050 |
Definition at line 52 of file cl_cinematic_roq.c.
Referenced by CIN_ROQ_DecodeSoundMono(), and CIN_ROQ_DecodeSoundStereo().
#define ROQ_SOUND_STEREO 0x1021 |
Definition at line 46 of file cl_cinematic_roq.c.
Referenced by CIN_ROQ_DecodeChunk().
#define ROQCIN (*((roqCinematic_t*)cin->codecData)) |
Definition at line 103 of file cl_cinematic_roq.c.
Referenced by CIN_ROQ_ApplyMotion4x4(), CIN_ROQ_ApplyMotion8x8(), CIN_ROQ_ApplyVector2x2(), CIN_ROQ_ApplyVector4x4(), CIN_ROQ_DecodeChunk(), CIN_ROQ_DecodeCodeBook(), CIN_ROQ_DecodeInfo(), CIN_ROQ_DecodeSoundMono(), CIN_ROQ_DecodeSoundStereo(), CIN_ROQ_DecodeVideo(), CIN_ROQ_DrawCinematic(), CIN_ROQ_PlayCinematic(), and CIN_ROQ_StopCinematic().
static void CIN_ROQ_ApplyMotion4x4 | ( | cinematic_t * | cin, | |
int | x, | |||
int | y, | |||
int | mx, | |||
int | my, | |||
int | mv | |||
) | [static] |
Definition at line 186 of file cl_cinematic_roq.c.
Referenced by CIN_ROQ_DecodeVideo().
static void CIN_ROQ_ApplyMotion8x8 | ( | cinematic_t * | cin, | |
int | x, | |||
int | y, | |||
int | mx, | |||
int | my, | |||
int | mv | |||
) | [static] |
Definition at line 205 of file cl_cinematic_roq.c.
Referenced by CIN_ROQ_DecodeVideo().
static void CIN_ROQ_ApplyVector2x2 | ( | cinematic_t * | cin, | |
int | x, | |||
int | y, | |||
const byte * | indices | |||
) | [static] |
Definition at line 122 of file cl_cinematic_roq.c.
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] |
Definition at line 145 of file cl_cinematic_roq.c.
References i, ROQCIN, and roqCin_quadOffsets4.
Referenced by CIN_ROQ_DecodeVideo().
static byte CIN_ROQ_ClampByte | ( | int | value | ) | [inline, static] |
Clamps integer value into byte.
Definition at line 108 of file cl_cinematic_roq.c.
Referenced by CIN_ROQ_DecodeCodeBook().
static qboolean CIN_ROQ_DecodeChunk | ( | cinematic_t * | cin | ) | [static] |
Definition at line 459 of file cl_cinematic_roq.c.
References CIN_ROQ_DecodeCodeBook(), CIN_ROQ_DecodeInfo(), CIN_ROQ_DecodeSoundMono(), CIN_ROQ_DecodeSoundStereo(), CIN_ROQ_DecodeVideo(), CL_Milliseconds(), Com_Printf(), FS_Read(), LittleLong(), LittleShort(), cinematic_s::noSound, qfalse, qtrue, cinematic_s::replay, ROQ_CHUNK_HEADER_SIZE, ROQ_IDENT, ROQ_MAX_CHUNK_SIZE, ROQ_QUAD_CODEBOOK, ROQ_QUAD_INFO, ROQ_QUAD_VQ, ROQ_SOUND_MONO, ROQ_SOUND_STEREO, ROQCIN, and cinematic_s::status.
Referenced by CIN_ROQ_RunCinematic().
static void CIN_ROQ_DecodeCodeBook | ( | cinematic_t * | cin, | |
const byte * | data | |||
) | [static] |
Definition at line 250 of file cl_cinematic_roq.c.
References byte, CIN_ROQ_ClampByte(), i, ROQCIN, yuvTable_t::ub, yuvTable_t::ug, yuvTable_t::vg, and yuvTable_t::vr.
Referenced by CIN_ROQ_DecodeChunk().
static void CIN_ROQ_DecodeInfo | ( | cinematic_t * | cin, | |
const byte * | data | |||
) | [static] |
Definition at line 228 of file cl_cinematic_roq.c.
References byte, cl_genericPool, Com_Error(), ERR_DROP, LittleShort(), Mem_PoolAlloc, Q_IsPowerOfTwo(), and ROQCIN.
Referenced by CIN_ROQ_DecodeChunk().
static void CIN_ROQ_DecodeSoundMono | ( | cinematic_t * | cin, | |
const byte * | data | |||
) | [static] |
Definition at line 418 of file cl_cinematic_roq.c.
References byte, i, M_AddToSampleBuffer(), ROQ_MAX_CHUNK_SIZE, ROQ_SOUND_RATE, ROQCIN, and roqCin_sqrTable.
Referenced by CIN_ROQ_DecodeChunk().
static void CIN_ROQ_DecodeSoundStereo | ( | cinematic_t * | cin, | |
const byte * | data | |||
) | [static] |
Definition at line 437 of file cl_cinematic_roq.c.
References byte, i, M_AddToSampleBuffer(), ROQ_MAX_CHUNK_SIZE, ROQ_SOUND_RATE, ROQCIN, and roqCin_sqrTable.
Referenced by CIN_ROQ_DecodeChunk().
static void CIN_ROQ_DecodeVideo | ( | cinematic_t * | cin, | |
const byte * | data | |||
) | [static] |
Definition at line 309 of file cl_cinematic_roq.c.
References byte, CIN_ROQ_ApplyMotion4x4(), CIN_ROQ_ApplyMotion8x8(), CIN_ROQ_ApplyVector2x2(), CIN_ROQ_ApplyVector4x4(), i, LittleShort(), ROQ_ID_CCC, ROQ_ID_FCC, ROQ_ID_SLD, ROQCIN, and roqCin_quadOffsets4.
Referenced by CIN_ROQ_DecodeChunk().
static void CIN_ROQ_DrawCinematic | ( | cinematic_t * | cin | ) | [static] |
Definition at line 520 of file cl_cinematic_roq.c.
References CIN_STATUS_NONE, cinematic_s::h, R_DrawTexture(), R_UploadData(), ROQCIN, cinematic_s::status, cinematic_s::w, cinematic_s::x, and cinematic_s::y.
Referenced by CIN_ROQ_RunCinematic().
void CIN_ROQ_Init | ( | void | ) |
Definition at line 623 of file cl_cinematic_roq.c.
References f, i, Q_ftol, roqCin_quadOffsets2, roqCin_quadOffsets4, roqCin_sqrTable, yuvTable_t::ub, yuvTable_t::ug, yuvTable_t::vg, and yuvTable_t::vr.
Referenced by CIN_Init().
void CIN_ROQ_PlayCinematic | ( | cinematic_t * | cin, | |
const char * | fileName | |||
) |
Definition at line 561 of file cl_cinematic_roq.c.
References byte, chunk(), CINEMATIC_TYPE_ROQ, cinematic_s::cinematicType, CL_Milliseconds(), cinematic_s::codecData, Com_Error(), Com_Printf(), ERR_DROP, FILE_READ, roqChunk_t::flags, FS_CloseFile(), FS_OpenFile(), FS_Read(), header, roqChunk_t::id, LittleLong(), LittleShort(), M_PlayMusicStream(), Mem_Free, Mem_PoolAlloc, cinematic_s::name, Q_strncpyz(), ROQ_CHUNK_HEADER_SIZE, ROQ_IDENT, ROQCIN, roqChunk_t::size, and vid_genericPool.
Referenced by CIN_PlayCinematic().
qboolean CIN_ROQ_RunCinematic | ( | cinematic_t * | cin | ) |
Definition at line 535 of file cl_cinematic_roq.c.
References CIN_ROQ_DecodeChunk(), and CIN_ROQ_DrawCinematic().
Referenced by CIN_RunCinematic().
void CIN_ROQ_StopCinematic | ( | cinematic_t * | cin | ) |
Definition at line 543 of file cl_cinematic_roq.c.
References cinematic_s::codecData, Com_Printf(), FS_CloseFile(), M_StopMusicStream(), Mem_Free, and ROQCIN.
Referenced by CIN_StopCinematic().
int roqCin_quadOffsets2[2][4] [static] |
Definition at line 100 of file cl_cinematic_roq.c.
Referenced by CIN_ROQ_ApplyVector2x2(), and CIN_ROQ_Init().
int roqCin_quadOffsets4[2][4] [static] |
Definition at line 101 of file cl_cinematic_roq.c.
Referenced by CIN_ROQ_ApplyVector4x4(), CIN_ROQ_DecodeVideo(), and CIN_ROQ_Init().
short roqCin_sqrTable[256] [static] |
Definition at line 97 of file cl_cinematic_roq.c.
Referenced by CIN_ROQ_DecodeSoundMono(), CIN_ROQ_DecodeSoundStereo(), and CIN_ROQ_Init().
yuvTable_t roqCin_yuvTable [static] |
Definition at line 98 of file cl_cinematic_roq.c.