@@ -49,6 +49,8 @@ GLSL_TEXTURES =1 # for shaders on models, leifxdither, etc
|
||||
GLSL_BACKEND =1 # for the entire backend.
|
||||
|
||||
|
||||
#Possible values "gnu90", "gnu99" and "gnu11". Note that the engine uses gnu-extensions. gnu90 is broken in the commit where this message is added. Travis does not support gnu11 at the moment.
|
||||
CFLAGS+="-std=gnu99"
|
||||
|
||||
|
||||
# You can change these although you probably don't need to
|
||||
|
@@ -35,7 +35,7 @@ int xmpspeed = 22050; // assume 22050hz unless........
|
||||
|
||||
|
||||
|
||||
// leilei - XMP
|
||||
// leilei - XMP
|
||||
xmp_context xmpsong;
|
||||
//int sound_init(int, int);
|
||||
void sound_play(void *, int);
|
||||
@@ -46,13 +46,15 @@ void sound_deinit(void);
|
||||
|
||||
extern int samplingrate; // from snd_dma
|
||||
|
||||
void S_XMP_StartSong ( void ){
|
||||
|
||||
void S_XMP_StartSong ( void )
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
void S_XMP_EndSong ( void ){
|
||||
void S_XMP_EndSong ( void )
|
||||
{
|
||||
|
||||
|
||||
|
||||
@@ -80,68 +82,61 @@ S_XMP_CodecOpenStream
|
||||
// FIXME: there's a memory leak here if you start the same song many many many many times.
|
||||
snd_stream_t *S_XMP_CodecOpenStream(const char *filename)
|
||||
{
|
||||
snd_stream_t *rv;
|
||||
|
||||
// First let's close whatever song we had....
|
||||
|
||||
// Open
|
||||
rv = S_CodecUtilOpen(filename, &xmp_codec);
|
||||
if(!rv)
|
||||
snd_stream_t *rv = S_CodecUtilOpen(filename, &xmp_codec);
|
||||
if(!rv) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Com_Printf("OPENSTREAM %s\n", filename);
|
||||
|
||||
|
||||
{
|
||||
fileHandle_t file;
|
||||
void *buffer;
|
||||
fileHandle_t file;
|
||||
|
||||
// Try to open the file
|
||||
FS_FOpenFileRead(filename, &file, qtrue);
|
||||
if(!file)
|
||||
{
|
||||
Com_Printf( S_COLOR_RED "ERROR: No.\"%s\"\n",filename);
|
||||
return NULL;
|
||||
}
|
||||
// Try to open the file
|
||||
FS_FOpenFileRead(filename, &file, qtrue);
|
||||
if(!file) {
|
||||
Com_Printf( S_COLOR_RED "ERROR: No.\"%s\"\n",filename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
// Allocate some memory
|
||||
long thelength = FS_ReadFile(filename, buffer);
|
||||
// Allocate some memory
|
||||
long thelength = FS_ReadFile(filename, NULL);
|
||||
|
||||
|
||||
buffer = Hunk_AllocateTempMemory(thelength);
|
||||
if(!buffer)
|
||||
{
|
||||
FS_FCloseFile(file);
|
||||
Com_Printf( S_COLOR_RED "ERROR: Out of memory reading \"%s\"\n",
|
||||
filename);
|
||||
return NULL;
|
||||
}
|
||||
void *buffer = Hunk_AllocateTempMemory(thelength);
|
||||
if(!buffer) {
|
||||
FS_FCloseFile(file);
|
||||
Com_Printf( S_COLOR_RED "ERROR: Out of memory reading \"%s\"\n", filename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
FS_Read(buffer, thelength, file);
|
||||
FS_Read(buffer, thelength, file);
|
||||
|
||||
|
||||
// OK!
|
||||
struct xmp_module_info mi;
|
||||
// OK!
|
||||
struct xmp_module_info mi;
|
||||
|
||||
xmpsong = xmp_create_context();
|
||||
int itsloaded = 0;
|
||||
xmpsong = xmp_create_context();
|
||||
int itsloaded = 0;
|
||||
|
||||
itsloaded = xmp_load_module_from_memory(xmpsong, buffer, 0);
|
||||
itsloaded = xmp_load_module_from_memory(xmpsong, buffer, 0);
|
||||
|
||||
// Free our memory and close the file.
|
||||
Hunk_FreeTempMemory(buffer);
|
||||
FS_FCloseFile(file); // unfortunately these do not help with the leak
|
||||
// Free our memory and close the file.
|
||||
Hunk_FreeTempMemory(buffer);
|
||||
FS_FCloseFile(file); // unfortunately these do not help with the leak
|
||||
|
||||
if (itsloaded == 0)
|
||||
itsloaded = xmp_start_player(xmpsong, xmpspeed, 0); // TODO: do sample rate of the mixer.
|
||||
|
||||
if (itsloaded == 0){
|
||||
|
||||
// Com_Printf("XMP loaded our buffer of the file %s which is %i long \n", filename, thelength);
|
||||
xmp_get_module_info(xmpsong, &mi);
|
||||
// Com_Printf("Song Name: %s\n", mi.mod->name);
|
||||
// Com_Printf("CODECLOAD %s\n", filename);
|
||||
|
||||
if (itsloaded == 0)
|
||||
itsloaded = xmp_start_player(xmpsong, xmpspeed, 0); // TODO: do sample rate of the mixer.
|
||||
|
||||
if (itsloaded == 0) {
|
||||
// Com_Printf("XMP loaded our buffer of the file %s which is %i long \n", filename, thelength);
|
||||
xmp_get_module_info(xmpsong, &mi);
|
||||
// Com_Printf("Song Name: %s\n", mi.mod->name);
|
||||
// Com_Printf("CODECLOAD %s\n", filename);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -183,64 +178,30 @@ int S_XMP_CodecReadStream(snd_stream_t *stream, int bytes, void *buffer)
|
||||
struct xmp_module_info mi;
|
||||
struct xmp_frame_info fi;
|
||||
|
||||
int bytesRead, bytesLeft, c;
|
||||
char *bufPtr;
|
||||
|
||||
// check if input is valid
|
||||
if(!(stream && buffer))
|
||||
{
|
||||
if(!(stream && buffer)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(bytes <= 0)
|
||||
{
|
||||
if(bytes <= 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
bytesRead = 0;
|
||||
bytesLeft = bytes;
|
||||
bufPtr = buffer;
|
||||
int yeah=xmp_play_buffer(xmpsong, buffer, bytes, 0);
|
||||
|
||||
// cycle until we have the requested or all available bytes read
|
||||
while(-1)
|
||||
{
|
||||
int yeah=xmp_play_buffer(xmpsong, buffer, bytesLeft, 0);
|
||||
|
||||
if (yeah == 0){ // if we can play it...
|
||||
if (yeah == 0) { // if we can play it...
|
||||
xmp_get_frame_info(xmpsong, &fi);
|
||||
|
||||
c = fi.buffer;
|
||||
|
||||
// no more bytes are left
|
||||
if(c <= 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
bytesRead += c;
|
||||
bytesLeft -= c;
|
||||
bufPtr += c;
|
||||
xmp_get_module_info(xmpsong, &mi);
|
||||
|
||||
// we have enough bytes
|
||||
if(bytesLeft <= 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
else // if we can't play it JUST STOP OK
|
||||
{
|
||||
break;
|
||||
|
||||
}
|
||||
xmp_get_module_info(xmpsong, &mi);
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return bytes;
|
||||
}
|
||||
|
||||
|
||||
snd_codec_t xmp_codec =
|
||||
{
|
||||
snd_codec_t xmp_codec = {
|
||||
"umx",
|
||||
S_XMP_CodecLoad,
|
||||
S_XMP_CodecOpenStream,
|
||||
@@ -249,8 +210,7 @@ snd_codec_t xmp_codec =
|
||||
NULL
|
||||
};
|
||||
|
||||
snd_codec_t xmp_mod_codec =
|
||||
{
|
||||
snd_codec_t xmp_mod_codec = {
|
||||
"mod",
|
||||
S_XMP_CodecLoad,
|
||||
S_XMP_CodecOpenStream,
|
||||
@@ -259,8 +219,7 @@ snd_codec_t xmp_mod_codec =
|
||||
NULL
|
||||
};
|
||||
|
||||
snd_codec_t xmp_it_codec =
|
||||
{
|
||||
snd_codec_t xmp_it_codec = {
|
||||
"it",
|
||||
S_XMP_CodecLoad,
|
||||
S_XMP_CodecOpenStream,
|
||||
@@ -269,8 +228,7 @@ snd_codec_t xmp_it_codec =
|
||||
NULL
|
||||
};
|
||||
|
||||
snd_codec_t xmp_s3m_codec =
|
||||
{
|
||||
snd_codec_t xmp_s3m_codec = {
|
||||
"s3m",
|
||||
S_XMP_CodecLoad,
|
||||
S_XMP_CodecOpenStream,
|
||||
@@ -279,8 +237,7 @@ snd_codec_t xmp_s3m_codec =
|
||||
NULL
|
||||
};
|
||||
|
||||
snd_codec_t xmp_xm_codec =
|
||||
{
|
||||
snd_codec_t xmp_xm_codec = {
|
||||
"xm",
|
||||
S_XMP_CodecLoad,
|
||||
S_XMP_CodecOpenStream,
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -193,10 +193,10 @@ cvar_t *r_lensReflectionBrightness;
|
||||
// leilei
|
||||
|
||||
cvar_t *r_flareMethod; // method of flare intensity
|
||||
cvar_t *r_flareQuality; // testing quality of the flares.
|
||||
cvar_t *r_flareQuality; // testing quality of the flares.
|
||||
cvar_t *r_flareSun; // type of flare to use for the sun
|
||||
cvar_t *r_flareDelay; // time delay for medium quality flare testing
|
||||
cvar_t *r_flaresMotionBlur; // Stretch blur
|
||||
cvar_t *r_flareDelay; // time delay for medium quality flare testing
|
||||
cvar_t *r_flaresMotionBlur; // Stretch blur
|
||||
|
||||
cvar_t *r_specMode;
|
||||
//cvar_t *r_waveMode;
|
||||
@@ -210,7 +210,7 @@ cvar_t *r_alternateBrightness; // leilei - linux overbright fix
|
||||
cvar_t *r_mockvr; // Leilei - for debugging PVR only!
|
||||
cvar_t *r_parseStageSimple; // Leilei - for debugging PVR only!
|
||||
cvar_t *r_leifx; // Leilei - leifx nostalgia filter
|
||||
cvar_t *r_modelshader; // Leilei
|
||||
cvar_t *r_modelshader; // Leilei
|
||||
cvar_t *r_particles; // Leilei - particle effects motif
|
||||
|
||||
cvar_t *r_ntsc; // Leilei - ntsc / composite signals
|
||||
@@ -284,11 +284,10 @@ static void InitOpenGL( void )
|
||||
// - r_ignorehwgamma
|
||||
// - r_gamma
|
||||
//
|
||||
|
||||
if ( glConfig.vidWidth == 0 )
|
||||
{
|
||||
|
||||
if ( glConfig.vidWidth == 0 ) {
|
||||
GLint temp;
|
||||
|
||||
|
||||
GLimp_Init();
|
||||
GLimp_InitExtraExtensions();
|
||||
|
||||
@@ -300,8 +299,7 @@ static void InitOpenGL( void )
|
||||
glConfig.maxTextureSize = temp;
|
||||
|
||||
// stubbed or broken drivers may have reported 0...
|
||||
if ( glConfig.maxTextureSize <= 0 )
|
||||
{
|
||||
if ( glConfig.maxTextureSize <= 0 ) {
|
||||
glConfig.maxTextureSize = 0;
|
||||
}
|
||||
}
|
||||
@@ -315,7 +313,8 @@ static void InitOpenGL( void )
|
||||
GL_CheckErrors
|
||||
==================
|
||||
*/
|
||||
void GL_CheckErrors( void ) {
|
||||
void GL_CheckErrors( void )
|
||||
{
|
||||
int err;
|
||||
char s[64];
|
||||
|
||||
@@ -327,27 +326,27 @@ void GL_CheckErrors( void ) {
|
||||
return;
|
||||
}
|
||||
switch( err ) {
|
||||
case GL_INVALID_ENUM:
|
||||
strcpy( s, "GL_INVALID_ENUM" );
|
||||
break;
|
||||
case GL_INVALID_VALUE:
|
||||
strcpy( s, "GL_INVALID_VALUE" );
|
||||
break;
|
||||
case GL_INVALID_OPERATION:
|
||||
strcpy( s, "GL_INVALID_OPERATION" );
|
||||
break;
|
||||
case GL_STACK_OVERFLOW:
|
||||
strcpy( s, "GL_STACK_OVERFLOW" );
|
||||
break;
|
||||
case GL_STACK_UNDERFLOW:
|
||||
strcpy( s, "GL_STACK_UNDERFLOW" );
|
||||
break;
|
||||
case GL_OUT_OF_MEMORY:
|
||||
strcpy( s, "GL_OUT_OF_MEMORY" );
|
||||
break;
|
||||
default:
|
||||
Com_sprintf( s, sizeof(s), "%i", err);
|
||||
break;
|
||||
case GL_INVALID_ENUM:
|
||||
strcpy( s, "GL_INVALID_ENUM" );
|
||||
break;
|
||||
case GL_INVALID_VALUE:
|
||||
strcpy( s, "GL_INVALID_VALUE" );
|
||||
break;
|
||||
case GL_INVALID_OPERATION:
|
||||
strcpy( s, "GL_INVALID_OPERATION" );
|
||||
break;
|
||||
case GL_STACK_OVERFLOW:
|
||||
strcpy( s, "GL_STACK_OVERFLOW" );
|
||||
break;
|
||||
case GL_STACK_UNDERFLOW:
|
||||
strcpy( s, "GL_STACK_UNDERFLOW" );
|
||||
break;
|
||||
case GL_OUT_OF_MEMORY:
|
||||
strcpy( s, "GL_OUT_OF_MEMORY" );
|
||||
break;
|
||||
default:
|
||||
Com_sprintf( s, sizeof(s), "%i", err);
|
||||
break;
|
||||
}
|
||||
|
||||
ri.Error( ERR_FATAL, "GL_CheckErrors: %s", s );
|
||||
@@ -357,15 +356,13 @@ void GL_CheckErrors( void ) {
|
||||
/*
|
||||
** R_GetModeInfo
|
||||
*/
|
||||
typedef struct vidmode_s
|
||||
{
|
||||
typedef struct vidmode_s {
|
||||
const char *description;
|
||||
int width, height;
|
||||
float pixelAspect; // pixel width / height
|
||||
} vidmode_t;
|
||||
|
||||
vidmode_t r_vidModes[] =
|
||||
{
|
||||
vidmode_t r_vidModes[] = {
|
||||
{ "Mode 0: 320x240", 320, 240, 1 },
|
||||
{ "Mode 1: 400x300", 400, 300, 1 },
|
||||
{ "Mode 2: 512x384", 512, 384, 1 },
|
||||
@@ -397,7 +394,8 @@ vidmode_t r_vidModes[] =
|
||||
};
|
||||
static int s_numVidModes = ARRAY_LEN( r_vidModes );
|
||||
|
||||
qboolean R_GetModeInfo( int *width, int *height, float *windowAspect, int mode ) {
|
||||
qboolean R_GetModeInfo( int *width, int *height, float *windowAspect, int mode )
|
||||
{
|
||||
vidmode_t *vm;
|
||||
float pixelAspect;
|
||||
|
||||
@@ -412,7 +410,8 @@ qboolean R_GetModeInfo( int *width, int *height, float *windowAspect, int mode )
|
||||
*width = r_customwidth->integer;
|
||||
*height = r_customheight->integer;
|
||||
pixelAspect = r_customPixelAspect->value;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
vm = &r_vidModes[mode];
|
||||
|
||||
*width = vm->width;
|
||||
@@ -433,18 +432,17 @@ static void R_ModeList_f( void )
|
||||
int i;
|
||||
|
||||
ri.Printf( PRINT_ALL, "\n" );
|
||||
for ( i = 0; i < s_numVidModes; i++ )
|
||||
{
|
||||
for ( i = 0; i < s_numVidModes; i++ ) {
|
||||
ri.Printf( PRINT_ALL, "%s\n", r_vidModes[i].description );
|
||||
}
|
||||
ri.Printf( PRINT_ALL, "\n" );
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
SCREEN SHOTS
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
SCREEN SHOTS
|
||||
|
||||
NOTE TTimo
|
||||
some thoughts about the screenshots system:
|
||||
@@ -457,11 +455,11 @@ we use statics to store a count and start writing the first screenshot/screensho
|
||||
(with FS_FileExists / FS_FOpenFileWrite calls)
|
||||
FIXME: the statics don't get a reinit between fs_game changes
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
==================
|
||||
/*
|
||||
==================
|
||||
RB_ReadPixels
|
||||
|
||||
Reads an image but takes care of alignment issues for reading RGB images.
|
||||
@@ -474,50 +472,50 @@ alignment of packAlign to ensure efficient copying.
|
||||
Stores the length of padding after a line of pixels to address padlen
|
||||
|
||||
Return value must be freed with ri.Hunk_FreeTempMemory()
|
||||
==================
|
||||
*/
|
||||
==================
|
||||
*/
|
||||
|
||||
byte *RB_ReadPixels(int x, int y, int width, int height, size_t *offset, int *padlen)
|
||||
{
|
||||
byte *buffer, *bufstart;
|
||||
int padwidth, linelen;
|
||||
GLint packAlign;
|
||||
|
||||
|
||||
qglGetIntegerv(GL_PACK_ALIGNMENT, &packAlign);
|
||||
|
||||
|
||||
linelen = width * 3;
|
||||
padwidth = PAD(linelen, packAlign);
|
||||
|
||||
|
||||
// Allocate a few more bytes so that we can choose an alignment we like
|
||||
buffer = ri.Hunk_AllocateTempMemory(padwidth * height + *offset + packAlign - 1);
|
||||
|
||||
|
||||
bufstart = PADP((intptr_t) buffer + *offset, packAlign);
|
||||
qglReadPixels(x, y, width, height, GL_RGB, GL_UNSIGNED_BYTE, bufstart);
|
||||
|
||||
|
||||
*offset = bufstart - buffer;
|
||||
*padlen = padwidth - linelen;
|
||||
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
/*
|
||||
==================
|
||||
RB_TakeScreenshot
|
||||
==================
|
||||
*/
|
||||
==================
|
||||
*/
|
||||
void RB_TakeScreenshot(int x, int y, int width, int height, char *fileName)
|
||||
{
|
||||
byte *allbuf, *buffer;
|
||||
byte *srcptr, *destptr;
|
||||
byte *endline, *endmem;
|
||||
byte temp;
|
||||
|
||||
|
||||
int linelen, padlen;
|
||||
size_t offset = 18, memcount;
|
||||
|
||||
|
||||
allbuf = RB_ReadPixels(x, y, width, height, &offset, &padlen);
|
||||
buffer = allbuf + offset - 18;
|
||||
|
||||
|
||||
Com_Memset (buffer, 0, 18);
|
||||
buffer[2] = 2; // uncompressed type
|
||||
buffer[12] = width & 255;
|
||||
@@ -528,24 +526,22 @@ void RB_TakeScreenshot(int x, int y, int width, int height, char *fileName)
|
||||
|
||||
// swap rgb to bgr and remove padding from line endings
|
||||
linelen = width * 3;
|
||||
|
||||
|
||||
srcptr = destptr = allbuf + offset;
|
||||
endmem = srcptr + (linelen + padlen) * height;
|
||||
|
||||
while(srcptr < endmem)
|
||||
{
|
||||
|
||||
while(srcptr < endmem) {
|
||||
endline = srcptr + linelen;
|
||||
|
||||
while(srcptr < endline)
|
||||
{
|
||||
while(srcptr < endline) {
|
||||
temp = srcptr[0];
|
||||
*destptr++ = srcptr[2];
|
||||
*destptr++ = srcptr[1];
|
||||
*destptr++ = temp;
|
||||
|
||||
|
||||
srcptr += 3;
|
||||
}
|
||||
|
||||
|
||||
// Skip the pad
|
||||
srcptr += padlen;
|
||||
}
|
||||
@@ -562,10 +558,10 @@ void RB_TakeScreenshot(int x, int y, int width, int height, char *fileName)
|
||||
ri.Hunk_FreeTempMemory(allbuf);
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
/*
|
||||
==================
|
||||
RB_TakeScreenshotJPEG
|
||||
==================
|
||||
==================
|
||||
*/
|
||||
|
||||
void RB_TakeScreenshotJPEG(int x, int y, int width, int height, char *fileName)
|
||||
@@ -594,26 +590,27 @@ RB_TakeScreenshotCmd
|
||||
extern int tvWidth;
|
||||
extern int tvHeight;
|
||||
|
||||
const void *RB_TakeScreenshotCmd( const void *data ) {
|
||||
const void *RB_TakeScreenshotCmd( const void *data )
|
||||
{
|
||||
const screenshotCommand_t *cmd;
|
||||
|
||||
cmd = (const screenshotCommand_t *)data;
|
||||
|
||||
// leilei - hack for tvmode
|
||||
if (r_tvMode->integer > -1){
|
||||
|
||||
if (cmd->jpeg)
|
||||
RB_TakeScreenshotJPEG( cmd->x, cmd->y, tvWidth, tvHeight, cmd->fileName);
|
||||
else
|
||||
RB_TakeScreenshot( cmd->x, cmd->y, tvWidth, tvHeight, cmd->fileName);
|
||||
}
|
||||
cmd = (const screenshotCommand_t *)data;
|
||||
|
||||
// leilei - hack for tvmode
|
||||
if (r_tvMode->integer > -1) {
|
||||
|
||||
if (cmd->jpeg)
|
||||
RB_TakeScreenshotJPEG( cmd->x, cmd->y, tvWidth, tvHeight, cmd->fileName);
|
||||
else
|
||||
RB_TakeScreenshot( cmd->x, cmd->y, tvWidth, tvHeight, cmd->fileName);
|
||||
}
|
||||
|
||||
if (cmd->jpeg)
|
||||
RB_TakeScreenshotJPEG( cmd->x, cmd->y, cmd->width, cmd->height, cmd->fileName);
|
||||
else
|
||||
RB_TakeScreenshot( cmd->x, cmd->y, cmd->width, cmd->height, cmd->fileName);
|
||||
|
||||
return (const void *)(cmd + 1);
|
||||
|
||||
return (const void *)(cmd + 1);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -621,7 +618,8 @@ const void *RB_TakeScreenshotCmd( const void *data ) {
|
||||
R_TakeScreenshot
|
||||
==================
|
||||
*/
|
||||
void R_TakeScreenshot( int x, int y, int width, int height, char *name, qboolean jpeg ) {
|
||||
void R_TakeScreenshot( int x, int y, int width, int height, char *name, qboolean jpeg )
|
||||
{
|
||||
static char fileName[MAX_OSPATH]; // bad things if two screenshots per frame?
|
||||
screenshotCommand_t *cmd;
|
||||
|
||||
@@ -640,12 +638,13 @@ void R_TakeScreenshot( int x, int y, int width, int height, char *name, qboolean
|
||||
cmd->jpeg = jpeg;
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
/*
|
||||
==================
|
||||
R_ScreenshotFilename
|
||||
==================
|
||||
*/
|
||||
void R_ScreenshotFilename( int lastNumber, char *fileName ) {
|
||||
==================
|
||||
*/
|
||||
void R_ScreenshotFilename( int lastNumber, char *fileName )
|
||||
{
|
||||
int a,b,c,d;
|
||||
|
||||
if ( lastNumber < 0 || lastNumber > 9999 ) {
|
||||
@@ -662,15 +661,16 @@ void R_ScreenshotFilename( int lastNumber, char *fileName ) {
|
||||
d = lastNumber;
|
||||
|
||||
Com_sprintf( fileName, MAX_OSPATH, "screenshots/shot%i%i%i%i.tga"
|
||||
, a, b, c, d );
|
||||
, a, b, c, d );
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
/*
|
||||
==================
|
||||
R_ScreenshotFilename
|
||||
==================
|
||||
*/
|
||||
void R_ScreenshotFilenameJPEG( int lastNumber, char *fileName ) {
|
||||
==================
|
||||
*/
|
||||
void R_ScreenshotFilenameJPEG( int lastNumber, char *fileName )
|
||||
{
|
||||
int a,b,c,d;
|
||||
|
||||
if ( lastNumber < 0 || lastNumber > 9999 ) {
|
||||
@@ -687,7 +687,7 @@ void R_ScreenshotFilenameJPEG( int lastNumber, char *fileName ) {
|
||||
d = lastNumber;
|
||||
|
||||
Com_sprintf( fileName, MAX_OSPATH, "screenshots/shot%i%i%i%i.jpg"
|
||||
, a, b, c, d );
|
||||
, a, b, c, d );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -698,7 +698,8 @@ levelshots are specialized 128*128 thumbnails for
|
||||
the menu system, sampled down from full screen distorted images
|
||||
====================
|
||||
*/
|
||||
void R_LevelShot( void ) {
|
||||
void R_LevelShot( void )
|
||||
{
|
||||
char checkname[MAX_OSPATH];
|
||||
byte *buffer;
|
||||
byte *source, *allsource;
|
||||
@@ -731,7 +732,7 @@ void R_LevelShot( void ) {
|
||||
for ( yy = 0 ; yy < 3 ; yy++ ) {
|
||||
for ( xx = 0 ; xx < 4 ; xx++ ) {
|
||||
src = source + (3 * glConfig.vidWidth + padlen) * (int)((y*3 + yy) * yScale) +
|
||||
3 * (int) ((x*4 + xx) * xScale);
|
||||
3 * (int) ((x*4 + xx) * xScale);
|
||||
r += src[0];
|
||||
g += src[1];
|
||||
b += src[2];
|
||||
@@ -757,8 +758,8 @@ void R_LevelShot( void ) {
|
||||
ri.Printf( PRINT_ALL, "Wrote %s\n", checkname );
|
||||
}
|
||||
|
||||
/*
|
||||
==================
|
||||
/*
|
||||
==================
|
||||
R_ScreenShot_f
|
||||
|
||||
screenshot
|
||||
@@ -767,9 +768,10 @@ screenshot [levelshot]
|
||||
screenshot [filename]
|
||||
|
||||
Doesn't print the pacifier message if there is a second arg
|
||||
==================
|
||||
*/
|
||||
void R_ScreenShot_f (void) {
|
||||
==================
|
||||
*/
|
||||
void R_ScreenShot_f (void)
|
||||
{
|
||||
char checkname[MAX_OSPATH];
|
||||
static int lastNumber = -1;
|
||||
qboolean silent;
|
||||
@@ -781,14 +783,16 @@ void R_ScreenShot_f (void) {
|
||||
|
||||
if ( !strcmp( ri.Cmd_Argv(1), "silent" ) ) {
|
||||
silent = qtrue;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
silent = qfalse;
|
||||
}
|
||||
|
||||
if ( ri.Cmd_Argc() == 2 && !silent ) {
|
||||
// explicit filename
|
||||
Com_sprintf( checkname, MAX_OSPATH, "screenshots/%s.tga", ri.Cmd_Argv( 1 ) );
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
// scan for a free filename
|
||||
|
||||
// if we have saved a previous screenshot, don't scan
|
||||
@@ -801,16 +805,15 @@ void R_ScreenShot_f (void) {
|
||||
for ( ; lastNumber <= 9999 ; lastNumber++ ) {
|
||||
R_ScreenshotFilename( lastNumber, checkname );
|
||||
|
||||
if (!ri.FS_FileExists( checkname ))
|
||||
{
|
||||
break; // file doesn't exist
|
||||
}
|
||||
if (!ri.FS_FileExists( checkname )) {
|
||||
break; // file doesn't exist
|
||||
}
|
||||
}
|
||||
|
||||
if ( lastNumber >= 9999 ) {
|
||||
ri.Printf (PRINT_ALL, "ScreenShot: Couldn't create a file\n");
|
||||
ri.Printf (PRINT_ALL, "ScreenShot: Couldn't create a file\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
lastNumber++;
|
||||
}
|
||||
@@ -820,9 +823,10 @@ void R_ScreenShot_f (void) {
|
||||
if ( !silent ) {
|
||||
ri.Printf (PRINT_ALL, "Wrote %s\n", checkname);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void R_ScreenShotJPEG_f (void) {
|
||||
void R_ScreenShotJPEG_f (void)
|
||||
{
|
||||
char checkname[MAX_OSPATH];
|
||||
static int lastNumber = -1;
|
||||
qboolean silent;
|
||||
@@ -834,14 +838,16 @@ void R_ScreenShotJPEG_f (void) {
|
||||
|
||||
if ( !strcmp( ri.Cmd_Argv(1), "silent" ) ) {
|
||||
silent = qtrue;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
silent = qfalse;
|
||||
}
|
||||
|
||||
if ( ri.Cmd_Argc() == 2 && !silent ) {
|
||||
// explicit filename
|
||||
Com_sprintf( checkname, MAX_OSPATH, "screenshots/%s.jpg", ri.Cmd_Argv( 1 ) );
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
// scan for a free filename
|
||||
|
||||
// if we have saved a previous screenshot, don't scan
|
||||
@@ -854,16 +860,15 @@ void R_ScreenShotJPEG_f (void) {
|
||||
for ( ; lastNumber <= 9999 ; lastNumber++ ) {
|
||||
R_ScreenshotFilenameJPEG( lastNumber, checkname );
|
||||
|
||||
if (!ri.FS_FileExists( checkname ))
|
||||
{
|
||||
break; // file doesn't exist
|
||||
}
|
||||
if (!ri.FS_FileExists( checkname )) {
|
||||
break; // file doesn't exist
|
||||
}
|
||||
}
|
||||
|
||||
if ( lastNumber == 10000 ) {
|
||||
ri.Printf (PRINT_ALL, "ScreenShot: Couldn't create a file\n");
|
||||
ri.Printf (PRINT_ALL, "ScreenShot: Couldn't create a file\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
lastNumber++;
|
||||
}
|
||||
@@ -873,7 +878,7 @@ void R_ScreenShotJPEG_f (void) {
|
||||
if ( !silent ) {
|
||||
ri.Printf (PRINT_ALL, "Wrote %s\n", checkname);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
|
||||
@@ -889,9 +894,9 @@ const void *RB_TakeVideoFrameCmd( const void *data )
|
||||
size_t memcount, linelen;
|
||||
int padwidth, avipadwidth, padlen, avipadlen;
|
||||
GLint packAlign;
|
||||
|
||||
|
||||
cmd = (const videoFrameCommand_t *)data;
|
||||
|
||||
|
||||
qglGetIntegerv(GL_PACK_ALIGNMENT, &packAlign);
|
||||
|
||||
linelen = cmd->width * 3;
|
||||
@@ -904,9 +909,9 @@ const void *RB_TakeVideoFrameCmd( const void *data )
|
||||
avipadlen = avipadwidth - linelen;
|
||||
|
||||
cBuf = PADP(cmd->captureBuffer, packAlign);
|
||||
|
||||
|
||||
qglReadPixels(0, 0, cmd->width, cmd->height, GL_RGB,
|
||||
GL_UNSIGNED_BYTE, cBuf);
|
||||
GL_UNSIGNED_BYTE, cBuf);
|
||||
|
||||
memcount = padwidth * cmd->height;
|
||||
|
||||
@@ -914,44 +919,40 @@ const void *RB_TakeVideoFrameCmd( const void *data )
|
||||
if(glConfig.deviceSupportsGamma)
|
||||
R_GammaCorrect(cBuf, memcount);
|
||||
|
||||
if(cmd->motionJpeg)
|
||||
{
|
||||
if(cmd->motionJpeg) {
|
||||
memcount = RE_SaveJPGToBuffer(cmd->encodeBuffer, linelen * cmd->height,
|
||||
r_aviMotionJpegQuality->integer,
|
||||
cmd->width, cmd->height, cBuf, padlen);
|
||||
r_aviMotionJpegQuality->integer,
|
||||
cmd->width, cmd->height, cBuf, padlen);
|
||||
ri.CL_WriteAVIVideoFrame(cmd->encodeBuffer, memcount);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
byte *lineend, *memend;
|
||||
byte *srcptr, *destptr;
|
||||
|
||||
|
||||
srcptr = cBuf;
|
||||
destptr = cmd->encodeBuffer;
|
||||
memend = srcptr + memcount;
|
||||
|
||||
|
||||
// swap R and B and remove line paddings
|
||||
while(srcptr < memend)
|
||||
{
|
||||
while(srcptr < memend) {
|
||||
lineend = srcptr + linelen;
|
||||
while(srcptr < lineend)
|
||||
{
|
||||
while(srcptr < lineend) {
|
||||
*destptr++ = srcptr[2];
|
||||
*destptr++ = srcptr[1];
|
||||
*destptr++ = srcptr[0];
|
||||
srcptr += 3;
|
||||
}
|
||||
|
||||
|
||||
Com_Memset(destptr, '\0', avipadlen);
|
||||
destptr += avipadlen;
|
||||
|
||||
|
||||
srcptr += padlen;
|
||||
}
|
||||
|
||||
|
||||
ri.CL_WriteAVIVideoFrame(cmd->encodeBuffer, avipadwidth * cmd->height);
|
||||
}
|
||||
|
||||
return (const void *)(cmd + 1);
|
||||
return (const void *)(cmd + 1);
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
@@ -1008,14 +1009,14 @@ R_PrintLongString
|
||||
Workaround for ri.Printf's 1024 characters buffer limit.
|
||||
================
|
||||
*/
|
||||
void R_PrintLongString(const char *string) {
|
||||
void R_PrintLongString(const char *string)
|
||||
{
|
||||
char buffer[1024];
|
||||
const char *p;
|
||||
int size = strlen(string);
|
||||
|
||||
p = string;
|
||||
while(size > 0)
|
||||
{
|
||||
while(size > 0) {
|
||||
Q_strncpyz(buffer, p, sizeof (buffer) );
|
||||
ri.Printf( PRINT_ALL, "%s", buffer );
|
||||
p += 1023;
|
||||
@@ -1028,15 +1029,13 @@ void R_PrintLongString(const char *string) {
|
||||
GfxInfo_f
|
||||
================
|
||||
*/
|
||||
void GfxInfo_f( void )
|
||||
void GfxInfo_f( void )
|
||||
{
|
||||
const char *enablestrings[] =
|
||||
{
|
||||
const char *enablestrings[] = {
|
||||
"disabled",
|
||||
"enabled"
|
||||
};
|
||||
const char *fsstrings[] =
|
||||
{
|
||||
const char *fsstrings[] = {
|
||||
"windowed",
|
||||
"fullscreen"
|
||||
};
|
||||
@@ -1051,20 +1050,16 @@ void GfxInfo_f( void )
|
||||
ri.Printf( PRINT_ALL, "GL_MAX_TEXTURE_UNITS_ARB: %d\n", glConfig.numTextureUnits );
|
||||
ri.Printf( PRINT_ALL, "\nPIXELFORMAT: color(%d-bits) Z(%d-bit) stencil(%d-bits)\n", glConfig.colorBits, glConfig.depthBits, glConfig.stencilBits );
|
||||
ri.Printf( PRINT_ALL, "MODE: %d, %d x %d %s hz:", r_mode->integer, glConfig.vidWidth, glConfig.vidHeight, fsstrings[r_fullscreen->integer == 1] );
|
||||
if ( glConfig.displayFrequency )
|
||||
{
|
||||
if ( glConfig.displayFrequency ) {
|
||||
ri.Printf( PRINT_ALL, "%d\n", glConfig.displayFrequency );
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
ri.Printf( PRINT_ALL, "N/A\n" );
|
||||
}
|
||||
if ( glConfig.deviceSupportsGamma )
|
||||
{
|
||||
if ( glConfig.deviceSupportsGamma ) {
|
||||
ri.Printf( PRINT_ALL, "GAMMA: hardware w/ %d overbright bits\n", tr.overbrightBits );
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
ri.Printf( PRINT_ALL, "GAMMA: software w/ %d overbright bits\n", tr.overbrightBits );
|
||||
}
|
||||
|
||||
@@ -1078,17 +1073,21 @@ void GfxInfo_f( void )
|
||||
if ( primitives == 0 ) {
|
||||
if ( qglLockArraysEXT ) {
|
||||
primitives = 2;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
primitives = 1;
|
||||
}
|
||||
}
|
||||
if ( primitives == -1 ) {
|
||||
ri.Printf( PRINT_ALL, "none\n" );
|
||||
} else if ( primitives == 2 ) {
|
||||
}
|
||||
else if ( primitives == 2 ) {
|
||||
ri.Printf( PRINT_ALL, "single glDrawElements\n" );
|
||||
} else if ( primitives == 1 ) {
|
||||
}
|
||||
else if ( primitives == 1 ) {
|
||||
ri.Printf( PRINT_ALL, "multiple glArrayElement\n" );
|
||||
} else if ( primitives == 3 ) {
|
||||
}
|
||||
else if ( primitives == 3 ) {
|
||||
ri.Printf( PRINT_ALL, "multiple glColor4ubv + glTexCoord2fv + glVertex3fv\n" );
|
||||
}
|
||||
}
|
||||
@@ -1101,33 +1100,30 @@ void GfxInfo_f( void )
|
||||
ri.Printf( PRINT_ALL, "texenv add: %s\n", enablestrings[glConfig.textureEnvAddAvailable != 0] );
|
||||
ri.Printf( PRINT_ALL, "compressed textures: %s\n", enablestrings[glConfig.textureCompression!=TC_NONE] );
|
||||
ri.Printf( PRINT_ALL, "glsl programs: %s\n", enablestrings[vertexShaders] );
|
||||
if ( r_vertexLight->integer || glConfig.hardwareType == GLHW_PERMEDIA2 )
|
||||
{
|
||||
if ( r_vertexLight->integer || glConfig.hardwareType == GLHW_PERMEDIA2 ) {
|
||||
ri.Printf( PRINT_ALL, "HACK: using vertex lightmap approximation\n" );
|
||||
}
|
||||
if ( glConfig.hardwareType == GLHW_RAGEPRO )
|
||||
{
|
||||
if ( glConfig.hardwareType == GLHW_RAGEPRO ) {
|
||||
ri.Printf( PRINT_ALL, "HACK: ragePro approximations\n" );
|
||||
}
|
||||
if ( glConfig.hardwareType == GLHW_RIVA128 )
|
||||
{
|
||||
if ( glConfig.hardwareType == GLHW_RIVA128 ) {
|
||||
ri.Printf( PRINT_ALL, "HACK: riva128 approximations\n" );
|
||||
}
|
||||
if ( r_finish->integer ) {
|
||||
ri.Printf( PRINT_ALL, "Forcing glFinish\n" );
|
||||
}
|
||||
if (voodootype){
|
||||
if (voodootype) {
|
||||
|
||||
if (voodootype == 1)
|
||||
ri.Printf( PRINT_ALL, "3Dfx Voodoo Graphics assumed\n" );
|
||||
else if (voodootype == 2)
|
||||
ri.Printf( PRINT_ALL, "3Dfx Voodoo2 assumed\n" );
|
||||
else if (voodootype == 3)
|
||||
ri.Printf( PRINT_ALL, "3dfx Voodoo3 assumed\n" );
|
||||
else if (voodootype == 4)
|
||||
ri.Printf( PRINT_ALL, "3dfx Voodoo 4 or 5 assumed\n" );
|
||||
|
||||
}
|
||||
if (voodootype == 1)
|
||||
ri.Printf( PRINT_ALL, "3Dfx Voodoo Graphics assumed\n" );
|
||||
else if (voodootype == 2)
|
||||
ri.Printf( PRINT_ALL, "3Dfx Voodoo2 assumed\n" );
|
||||
else if (voodootype == 3)
|
||||
ri.Printf( PRINT_ALL, "3dfx Voodoo3 assumed\n" );
|
||||
else if (voodootype == 4)
|
||||
ri.Printf( PRINT_ALL, "3dfx Voodoo 4 or 5 assumed\n" );
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1138,11 +1134,11 @@ void GfxInfo_f( void )
|
||||
R_Register
|
||||
===============
|
||||
*/
|
||||
void R_Register( void )
|
||||
void R_Register( void )
|
||||
{
|
||||
#ifdef USE_RENDERER_DLOPEN
|
||||
#ifdef USE_RENDERER_DLOPEN
|
||||
com_altivec = ri.Cvar_Get("com_altivec", "1", CVAR_ARCHIVE);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined( _WIN32 )
|
||||
// leilei - Get some version info first, code torn from quake
|
||||
@@ -1162,7 +1158,7 @@ void R_Register( void )
|
||||
r_ext_texture_env_add = ri.Cvar_Get( "r_ext_texture_env_add", "1", CVAR_ARCHIVE | CVAR_LATCH);
|
||||
|
||||
r_ext_texture_filter_anisotropic = ri.Cvar_Get( "r_ext_texture_filter_anisotropic",
|
||||
"0", CVAR_ARCHIVE | CVAR_LATCH );
|
||||
"0", CVAR_ARCHIVE | CVAR_LATCH );
|
||||
r_ext_max_anisotropy = ri.Cvar_Get( "r_ext_max_anisotropy", "2", CVAR_ARCHIVE | CVAR_LATCH );
|
||||
r_ext_paletted_texture = ri.Cvar_Get( "r_ext_paletted_texture", "0", CVAR_ARCHIVE | CVAR_LATCH ); // leilei - paletted texture support
|
||||
r_ext_gamma_control = ri.Cvar_Get( "r_ext_gamma_control", "1", CVAR_ARCHIVE | CVAR_LATCH ); // leilei - 3dfx gamma support
|
||||
@@ -1186,9 +1182,9 @@ void R_Register( void )
|
||||
#if defined( _WIN32 )
|
||||
|
||||
if (vinfo.dwPlatformId == VER_PLATFORM_WIN32_NT) // Win2000 and up
|
||||
r_mode = ri.Cvar_Get( "r_mode", "-2", CVAR_ARCHIVE | CVAR_LATCH ); // leilei - -2 is so convenient for modern day PCs
|
||||
r_mode = ri.Cvar_Get( "r_mode", "-2", CVAR_ARCHIVE | CVAR_LATCH ); // leilei - -2 is so convenient for modern day PCs
|
||||
else // WinNT4/WinME and below
|
||||
r_mode = ri.Cvar_Get( "r_mode", "3", CVAR_ARCHIVE | CVAR_LATCH ); // leilei - initialize 640x480 for <2000 users as there's a problem at figuring out desktop res on them
|
||||
r_mode = ri.Cvar_Get( "r_mode", "3", CVAR_ARCHIVE | CVAR_LATCH ); // leilei - initialize 640x480 for <2000 users as there's a problem at figuring out desktop res on them
|
||||
|
||||
#else
|
||||
|
||||
@@ -1238,7 +1234,7 @@ void R_Register( void )
|
||||
r_finish = ri.Cvar_Get ("r_finish", "0", CVAR_ARCHIVE);
|
||||
r_textureMode = ri.Cvar_Get( "r_textureMode", "GL_LINEAR_MIPMAP_NEAREST", CVAR_ARCHIVE );
|
||||
r_swapInterval = ri.Cvar_Get( "r_swapInterval", "0",
|
||||
CVAR_ARCHIVE | CVAR_LATCH );
|
||||
CVAR_ARCHIVE | CVAR_LATCH );
|
||||
r_gamma = ri.Cvar_Get( "r_gamma", "1", CVAR_ARCHIVE );
|
||||
r_facePlaneCull = ri.Cvar_Get ("r_facePlaneCull", "1", CVAR_ARCHIVE );
|
||||
|
||||
@@ -1309,16 +1305,16 @@ void R_Register( void )
|
||||
|
||||
|
||||
|
||||
r_specMode = ri.Cvar_Get( "r_specMode", "1" , CVAR_ARCHIVE );
|
||||
r_specMode = ri.Cvar_Get( "r_specMode", "1" , CVAR_ARCHIVE );
|
||||
//r_waveMode = ri.Cvar_Get( "r_waveMode", "0" , CVAR_ARCHIVE );
|
||||
|
||||
|
||||
r_lensReflection1 = ri.Cvar_Get( "r_lensReflection1", "1" , CVAR_ARCHIVE); // sharp reflection
|
||||
r_lensReflection2 = ri.Cvar_Get( "r_lensReflection2", "0" , CVAR_ARCHIVE); // fuzzy reflection
|
||||
r_lensReflectionBrightness = ri.Cvar_Get( "r_lensReflectionBrightness", "0.5" , CVAR_ARCHIVE);
|
||||
|
||||
r_flareQuality = ri.Cvar_Get( "r_flareQuality", "4" , CVAR_ARCHIVE); // use high flares for default (lower settings stutter vsync or clip too badly)
|
||||
r_flareMethod = ri.Cvar_Get( "r_flareMethod", "0" , CVAR_ARCHIVE);
|
||||
r_flaresDlight = ri.Cvar_Get( "r_flaresDlight", "0" , CVAR_ARCHIVE ); // dynamic light flares
|
||||
r_flareMethod = ri.Cvar_Get( "r_flareMethod", "0" , CVAR_ARCHIVE);
|
||||
r_flaresDlight = ri.Cvar_Get( "r_flaresDlight", "0" , CVAR_ARCHIVE ); // dynamic light flares
|
||||
r_flaresDlightShrink = ri.Cvar_Get( "r_flaresDlightShrink", "1" , CVAR_ARCHIVE ); // dynamic light flares shrinking when close (reducing muzzleflash blindness)
|
||||
r_flaresDlightFade = ri.Cvar_Get( "r_flaresDlightFade", "0" , CVAR_ARCHIVE | CVAR_CHEAT ); // dynamic light flares fading (workaround clipping bug)
|
||||
r_flaresDlightOpacity = ri.Cvar_Get( "r_flaresDlightOpacity", "0.5" , CVAR_ARCHIVE ); // dynamic light flares (workaround poor visibility)
|
||||
@@ -1330,28 +1326,28 @@ void R_Register( void )
|
||||
|
||||
|
||||
|
||||
r_mockvr = ri.Cvar_Get( "r_mockvr", "0" , CVAR_CHEAT);
|
||||
r_parseStageSimple = ri.Cvar_Get( "r_parseStageSimple", "0" , CVAR_CHEAT);
|
||||
r_leifx = ri.Cvar_Get( "r_leifx", "0" , CVAR_ARCHIVE | CVAR_LATCH);
|
||||
r_mockvr = ri.Cvar_Get( "r_mockvr", "0" , CVAR_CHEAT);
|
||||
r_parseStageSimple = ri.Cvar_Get( "r_parseStageSimple", "0" , CVAR_CHEAT);
|
||||
r_leifx = ri.Cvar_Get( "r_leifx", "0" , CVAR_ARCHIVE | CVAR_LATCH);
|
||||
r_modelshader = ri.Cvar_Get( "r_modelshader", "0" , CVAR_ARCHIVE | CVAR_LATCH); // leilei - load and use special shaders for lightDiffuse models
|
||||
r_detailTextureScale = ri.Cvar_Get( "r_detailtextureScale", "0", CVAR_ARCHIVE | CVAR_LATCH ); // leilei - adjust scale of detail textures
|
||||
r_detailTextureLayers = ri.Cvar_Get( "r_detailtextureLayers", "0", CVAR_ARCHIVE | CVAR_LATCH ); // leilei - add more detail layers
|
||||
|
||||
r_ntsc = ri.Cvar_Get( "r_ntsc", "0" , CVAR_ARCHIVE | CVAR_LATCH); // leilei - ntsc filter
|
||||
|
||||
//r_tvMode = ri.Cvar_Get( "r_tvMode", "0" , CVAR_ARCHIVE | CVAR_LATCH);
|
||||
r_retroAA = ri.Cvar_Get( "r_retroAA", "0" , CVAR_ARCHIVE | CVAR_LATCH);
|
||||
//r_tvMode = ri.Cvar_Get( "r_tvMode", "0" , CVAR_ARCHIVE | CVAR_LATCH);
|
||||
r_retroAA = ri.Cvar_Get( "r_retroAA", "0" , CVAR_ARCHIVE | CVAR_LATCH);
|
||||
|
||||
r_suggestiveThemes = ri.Cvar_Get( "r_suggestiveThemes", "1" , CVAR_ARCHIVE | CVAR_LATCH);
|
||||
r_suggestiveThemes = ri.Cvar_Get( "r_suggestiveThemes", "1" , CVAR_ARCHIVE | CVAR_LATCH);
|
||||
|
||||
// r_motionblur = ri.Cvar_Get( "r_motionblur", "0" , CVAR_ARCHIVE | CVAR_LATCH);
|
||||
r_motionblur_fps = ri.Cvar_Get( "r_motionblur_fps", "60", 0);
|
||||
// r_motionblur = ri.Cvar_Get( "r_motionblur", "0" , CVAR_ARCHIVE | CVAR_LATCH);
|
||||
r_motionblur_fps = ri.Cvar_Get( "r_motionblur_fps", "60", 0);
|
||||
|
||||
r_anime = ri.Cvar_Get( "r_anime", "0" , CVAR_ARCHIVE | CVAR_LATCH);
|
||||
r_palletize = ri.Cvar_Get( "r_palletize", "0" , CVAR_ARCHIVE | CVAR_LATCH);
|
||||
r_leidebug = ri.Cvar_Get( "r_leidebug", "0" , CVAR_CHEAT);
|
||||
r_particles = ri.Cvar_Get( "r_particles", "0" , CVAR_ARCHIVE | CVAR_LATCH);
|
||||
r_leidebugeye = ri.Cvar_Get( "r_leidebugeye", "0" , CVAR_CHEAT);
|
||||
r_anime = ri.Cvar_Get( "r_anime", "0" , CVAR_ARCHIVE | CVAR_LATCH);
|
||||
r_palletize = ri.Cvar_Get( "r_palletize", "0" , CVAR_ARCHIVE | CVAR_LATCH);
|
||||
r_leidebug = ri.Cvar_Get( "r_leidebug", "0" , CVAR_CHEAT);
|
||||
r_particles = ri.Cvar_Get( "r_particles", "0" , CVAR_ARCHIVE | CVAR_LATCH);
|
||||
r_leidebugeye = ri.Cvar_Get( "r_leidebugeye", "0" , CVAR_CHEAT);
|
||||
r_slowness = ri.Cvar_Get( "r_slowness", "0" , CVAR_ARCHIVE); // it's 0 because you want it to be the fastest possible by default.
|
||||
r_slowness_cpu = ri.Cvar_Get( "r_slowness_cpu", "300" , CVAR_ARCHIVE); // it's 0 because you want it to be the fastest possible by default.
|
||||
r_slowness_gpu = ri.Cvar_Get( "r_slowness_gpu", "96" , CVAR_ARCHIVE); // it's 0 because you want it to be the fastest possible by default.
|
||||
@@ -1385,7 +1381,8 @@ void R_Register( void )
|
||||
* R_GLSL_AllocProgram
|
||||
* Reserve memory for program
|
||||
*/
|
||||
static glslProgram_t *R_GLSL_AllocProgram(void) {
|
||||
static glslProgram_t *R_GLSL_AllocProgram(void)
|
||||
{
|
||||
glslProgram_t *program;
|
||||
|
||||
if (tr.numPrograms == MAX_PROGRAMS)
|
||||
@@ -1425,10 +1422,10 @@ static glslProgram_t *R_GLSL_AllocProgram(void) {
|
||||
program->u_ViewOrigin = -1;
|
||||
program->u_Normal = -1;
|
||||
|
||||
program->u_mpass1 = -1;
|
||||
program->u_mpass2 = -1;
|
||||
program->u_mpass3 = -1;
|
||||
program->u_mpass4 = -1;
|
||||
program->u_mpass1 = -1;
|
||||
program->u_mpass2 = -1;
|
||||
program->u_mpass3 = -1;
|
||||
program->u_mpass4 = -1;
|
||||
|
||||
|
||||
program->rubyTextureSize = -1;
|
||||
@@ -1446,7 +1443,8 @@ static glslProgram_t *R_GLSL_AllocProgram(void) {
|
||||
* Load all default GLSL programs which are not loaded via the q3 shader system
|
||||
*/
|
||||
|
||||
void R_GLSL_Init(void) {
|
||||
void R_GLSL_Init(void)
|
||||
{
|
||||
#ifdef GLSL_BACKEND
|
||||
glslProgram_t *program;
|
||||
char programVertexObjects[MAX_PROGRAM_OBJECTS][MAX_QPATH];
|
||||
@@ -1549,8 +1547,7 @@ void R_GLSL_Init(void) {
|
||||
Q_strncpyz(programFragmentObjects[0], "glsl/ntsc_bleed_fp.glsl", sizeof(programFragmentObjects[0]));
|
||||
tr.NTSCBleedProgram = RE_GLSL_RegisterProgram("ntsc_bleed", (const char *)programVertexObjects, 1, (const char *)programFragmentObjects, 1);
|
||||
|
||||
if (strcmp( (const char *)r_postprocess->string, "none" ))
|
||||
{
|
||||
if (strcmp( (const char *)r_postprocess->string, "none" )) {
|
||||
sprintf(p,"glsl/%s_vp.glsl",r_postprocess->string);
|
||||
Q_strncpyz(programVertexObjects[0], (const char *)&p, sizeof(programVertexObjects[0]));
|
||||
sprintf(p,"glsl/%s_fp.glsl",r_postprocess->string);
|
||||
@@ -1560,7 +1557,7 @@ void R_GLSL_Init(void) {
|
||||
else
|
||||
ri.Printf( PRINT_ALL, "WARNING: Cannot locate postprocessing glsl program %s\n" ,r_postprocess->string);
|
||||
if (tr.postprocessingProgram) postprocess=qtrue;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
extern qboolean initparticles;
|
||||
@@ -1570,7 +1567,8 @@ extern qboolean initparticles;
|
||||
R_Init
|
||||
===============
|
||||
*/
|
||||
void R_Init( void ) {
|
||||
void R_Init( void )
|
||||
{
|
||||
int err;
|
||||
int i;
|
||||
byte *ptr;
|
||||
@@ -1595,26 +1593,21 @@ void R_Init( void ) {
|
||||
//
|
||||
// init function tables
|
||||
//
|
||||
for ( i = 0; i < FUNCTABLE_SIZE; i++ )
|
||||
{
|
||||
for ( i = 0; i < FUNCTABLE_SIZE; i++ ) {
|
||||
tr.sinTable[i] = sin( DEG2RAD( i * 360.0f / ( ( float ) ( FUNCTABLE_SIZE - 1 ) ) ) );
|
||||
tr.squareTable[i] = ( i < FUNCTABLE_SIZE/2 ) ? 1.0f : -1.0f;
|
||||
tr.sawToothTable[i] = (float)i / FUNCTABLE_SIZE;
|
||||
tr.inverseSawToothTable[i] = 1.0f - tr.sawToothTable[i];
|
||||
|
||||
if ( i < FUNCTABLE_SIZE / 2 )
|
||||
{
|
||||
if ( i < FUNCTABLE_SIZE / 4 )
|
||||
{
|
||||
if ( i < FUNCTABLE_SIZE / 2 ) {
|
||||
if ( i < FUNCTABLE_SIZE / 4 ) {
|
||||
tr.triangleTable[i] = ( float ) i / ( FUNCTABLE_SIZE / 4 );
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
tr.triangleTable[i] = 1.0f - tr.triangleTable[i-FUNCTABLE_SIZE / 4];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
tr.triangleTable[i] = -tr.triangleTable[i-FUNCTABLE_SIZE/2];
|
||||
}
|
||||
}
|
||||
@@ -1672,7 +1665,8 @@ void R_Init( void ) {
|
||||
RE_Shutdown
|
||||
===============
|
||||
*/
|
||||
void RE_Shutdown( qboolean destroyWindow ) {
|
||||
void RE_Shutdown( qboolean destroyWindow )
|
||||
{
|
||||
|
||||
ri.Printf( PRINT_ALL, "RE_Shutdown( %i )\n", destroyWindow );
|
||||
|
||||
@@ -1715,7 +1709,8 @@ RE_EndRegistration
|
||||
Touch all images to make sure they are resident
|
||||
=============
|
||||
*/
|
||||
void RE_EndRegistration( void ) {
|
||||
void RE_EndRegistration( void )
|
||||
{
|
||||
R_IssuePendingRenderCommands();
|
||||
if (!ri.Sys_LowPhysicalMemory()) {
|
||||
RB_ShowImages();
|
||||
@@ -1730,9 +1725,11 @@ GetRefAPI
|
||||
@@@@@@@@@@@@@@@@@@@@@
|
||||
*/
|
||||
#ifdef USE_RENDERER_DLOPEN
|
||||
Q_EXPORT refexport_t* QDECL GetRefAPI ( int apiVersion, refimport_t *rimp ) {
|
||||
Q_EXPORT refexport_t* QDECL GetRefAPI ( int apiVersion, refimport_t *rimp )
|
||||
{
|
||||
#else
|
||||
refexport_t *GetRefAPI ( int apiVersion, refimport_t *rimp ) {
|
||||
refexport_t *GetRefAPI ( int apiVersion, refimport_t *rimp )
|
||||
{
|
||||
#endif
|
||||
|
||||
static refexport_t re;
|
||||
@@ -1742,8 +1739,8 @@ refexport_t *GetRefAPI ( int apiVersion, refimport_t *rimp ) {
|
||||
Com_Memset( &re, 0, sizeof( re ) );
|
||||
|
||||
if ( apiVersion != REF_API_VERSION ) {
|
||||
ri.Printf(PRINT_ALL, "Mismatched REF_API_VERSION: expected %i, got %i\n",
|
||||
REF_API_VERSION, apiVersion );
|
||||
ri.Printf(PRINT_ALL, "Mismatched REF_API_VERSION: expected %i, got %i\n",
|
||||
REF_API_VERSION, apiVersion );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@@ -2373,18 +2373,18 @@ void R_MotionBlur_BackupScreen(int which);
|
||||
void R_AddParticles (void);
|
||||
void R_RenderParticles (void);
|
||||
void R_ClearParticles (void);
|
||||
void R_LFX_Spark (vec3_t org, vec3_t dir, float spread, float speed, vec4_t color1, vec4_t color2, vec4_t color3, vec4_t color4, vec4_t color5, int count, int duration, float scaleup, int blendfunc);
|
||||
void R_LFX_Smoke (vec3_t org, vec3_t dir, float spread, float speed, vec4_t color1, vec4_t color2, vec4_t color3, vec4_t color4, vec4_t color5, int count, int duration, float scaleup, int blendfunc);
|
||||
void R_LFX_Smoke2 (vec3_t org, vec3_t dir, float spread, float speed, vec4_t color1, vec4_t color2, vec4_t color3, vec4_t color4, vec4_t color5, int count, int duration, float scale, float scaleup, int blendfunc);
|
||||
void R_LFX_Shock (vec3_t org, vec3_t dir, float spread, float speed, vec4_t color1, vec4_t color2, vec4_t color3, vec4_t color4, vec4_t color5, int count, int duration, float scaleup, int blendfunc);
|
||||
void R_LFX_Burst (vec3_t org, vec3_t dir, float spread, float speed, vec4_t color1, vec4_t color2, vec4_t color3, vec4_t color4, vec4_t color5, int count, int duration, float scaleup, int blendfunc);
|
||||
void R_LFX_PushSmoke (vec3_t there, float force);
|
||||
void R_LFX_Spark (const vec3_t org, const vec3_t dir, float spread, float speed, vec4_t color1, vec4_t color2, vec4_t color3, vec4_t color4, vec4_t color5, int count, int duration, float scaleup, int blendfunc);
|
||||
void R_LFX_Smoke (const vec3_t org, const vec3_t dir, float spread, float speed, vec4_t color1, vec4_t color2, vec4_t color3, vec4_t color4, vec4_t color5, int count, int duration, float scaleup, int blendfunc);
|
||||
void R_LFX_Smoke2 (const vec3_t org, const vec3_t dir, float spread, float speed, vec4_t color1, vec4_t color2, vec4_t color3, vec4_t color4, vec4_t color5, int count, int duration, float scale, float scaleup, int blendfunc);
|
||||
void R_LFX_Shock (const vec3_t org, const vec3_t dir, float spread, float speed, vec4_t color1, vec4_t color2, vec4_t color3, vec4_t color4, vec4_t color5, int count, int duration, float scaleup, int blendfunc);
|
||||
void R_LFX_Burst (const vec3_t org, const vec3_t dir, float spread, float speed, vec4_t color1, vec4_t color2, vec4_t color3, vec4_t color4, vec4_t color5, int count, int duration, float scaleup, int blendfunc);
|
||||
void R_LFX_PushSmoke (const vec3_t there, float force);
|
||||
|
||||
void R_RunParticleEffect (vec3_t org, vec3_t dir, int color, int count);
|
||||
void R_QarticleExplosion(vec3_t org);
|
||||
void R_LFX_Blood (vec3_t org, vec3_t dir, float pressure) ;
|
||||
void R_RunParticleEffect (const vec3_t org, const vec3_t dir, int color, int count);
|
||||
void R_QarticleExplosion(const vec3_t org);
|
||||
void R_LFX_Blood (const vec3_t org, const vec3_t dir, float pressure) ;
|
||||
void LFX_ShaderInit(void);
|
||||
void LFX_ParticleEffect (int effect, vec3_t org, vec3_t dir);
|
||||
void LFX_ParticleEffect (int effect, const vec3_t org, const vec3_t dir);
|
||||
|
||||
#endif //TR_LOCAL_H
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user