cl_cinematic_roq.c File Reference

#include "cl_cinematic_roq.h"
#include "cl_cinematic.h"
#include "../renderer/r_draw.h"
#include "../sound/s_main.h"
#include "../sound/s_music.h"
Include dependency graph for cl_cinematic_roq.c:

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]

Detailed Description

Note:
This code based on the OverDose and KMQuakeII source code

Definition in file cl_cinematic_roq.c.


Define Documentation

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

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 186 of file cl_cinematic_roq.c.

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 205 of file cl_cinematic_roq.c.

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 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]
See also:
CIN_ROQ_DecodeVideo

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]
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_DecodeVideo ( cinematic_t cin,
const byte data 
) [static]
static void CIN_ROQ_DrawCinematic ( cinematic_t cin  )  [static]
void CIN_ROQ_Init ( void   ) 
void CIN_ROQ_PlayCinematic ( cinematic_t cin,
const char *  fileName 
)
qboolean CIN_ROQ_RunCinematic ( cinematic_t cin  ) 
Returns:
true if the cinematic is still running, false otherwise

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  ) 

Variable Documentation

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 98 of file cl_cinematic_roq.c.


Generated by  doxygen 1.6.2