#include "tr_local.h"
Include dependency graph for tr_init.c:

Go to the source code of this file.
|
|
Referenced by R_GetModeInfo(). |
|
||||||||||||||||||||
|
Definition at line 158 of file tr_init.c. References refimport_t::Cvar_Set, cvar_t, cvar_s::integer, cvar_s::name, PRINT_WARNING, ri, va(), and cvar_s::value. Referenced by R_Register(). 00159 {
00160 if ( shouldBeIntegral )
00161 {
00162 if ( ( int ) cv->value != cv->integer )
00163 {
00164 ri.Printf( PRINT_WARNING, "WARNING: cvar '%s' must be integral (%f)\n", cv->name, cv->value );
00165 ri.Cvar_Set( cv->name, va( "%d", cv->integer ) );
00166 }
00167 }
00168
00169 if ( cv->value < minVal )
00170 {
00171 ri.Printf( PRINT_WARNING, "WARNING: cvar '%s' out of range (%f < %f)\n", cv->name, cv->value, minVal );
00172 ri.Cvar_Set( cv->name, va( "%f", minVal ) );
00173 }
00174 else if ( cv->value > maxVal )
00175 {
00176 ri.Printf( PRINT_WARNING, "WARNING: cvar '%s' out of range (%f > %f)\n", cv->name, cv->value, maxVal );
00177 ri.Cvar_Set( cv->name, va( "%f", maxVal ) );
00178 }
00179 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 1165 of file tr_init.c. References refexport_t::AddAdditiveLightToScene, refexport_t::AddLightToScene, refexport_t::AddPolyToScene, refexport_t::AddRefEntityToScene, refexport_t::BeginFrame, refexport_t::BeginRegistration, refexport_t::ClearScene, Com_Memset(), refexport_t::DrawStretchPic, refexport_t::DrawStretchRaw, refexport_t::EndFrame, refexport_t::EndRegistration, refexport_t::GetEntityToken, refexport_t::inPVS, refexport_t::LerpTag, refexport_t::LightForPoint, refexport_t::LoadWorld, refexport_t::MarkFragments, refexport_t::ModelBounds, PRINT_ALL, re, REF_API_VERSION, refexport_t::RegisterFont, refexport_t::RegisterModel, refexport_t::RegisterShader, refexport_t::RegisterShaderNoMip, refexport_t::RegisterSkin, refexport_t::RemapShader, refexport_t::RenderScene, ri, refexport_t::SetColor, refexport_t::SetWorldVisData, refexport_t::Shutdown, and refexport_t::UploadCinematic. Referenced by CL_InitRef(). 01165 {
01166 static refexport_t re;
01167
01168 ri = *rimp;
01169
01170 Com_Memset( &re, 0, sizeof( re ) );
01171
01172 if ( apiVersion != REF_API_VERSION ) {
01173 ri.Printf(PRINT_ALL, "Mismatched REF_API_VERSION: expected %i, got %i\n",
01174 REF_API_VERSION, apiVersion );
01175 return NULL;
01176 }
01177
01178 // the RE_ functions are Renderer Entry points
01179
01180 re.Shutdown = RE_Shutdown;
01181
01182 re.BeginRegistration = RE_BeginRegistration;
01183 re.RegisterModel = RE_RegisterModel;
01184 re.RegisterSkin = RE_RegisterSkin;
01185 re.RegisterShader = RE_RegisterShader;
01186 re.RegisterShaderNoMip = RE_RegisterShaderNoMip;
01187 re.LoadWorld = RE_LoadWorldMap;
01188 re.SetWorldVisData = RE_SetWorldVisData;
01189 re.EndRegistration = RE_EndRegistration;
01190
01191 re.BeginFrame = RE_BeginFrame;
01192 re.EndFrame = RE_EndFrame;
01193
01194 re.MarkFragments = R_MarkFragments;
01195 re.LerpTag = R_LerpTag;
01196 re.ModelBounds = R_ModelBounds;
01197
01198 re.ClearScene = RE_ClearScene;
01199 re.AddRefEntityToScene = RE_AddRefEntityToScene;
01200 re.AddPolyToScene = RE_AddPolyToScene;
01201 re.LightForPoint = R_LightForPoint;
01202 re.AddLightToScene = RE_AddLightToScene;
01203 re.AddAdditiveLightToScene = RE_AddAdditiveLightToScene;
01204 re.RenderScene = RE_RenderScene;
01205
01206 re.SetColor = RE_SetColor;
01207 re.DrawStretchPic = RE_StretchPic;
01208 re.DrawStretchRaw = RE_StretchRaw;
01209 re.UploadCinematic = RE_UploadCinematic;
01210
01211 re.RegisterFont = RE_RegisterFont;
01212 re.RemapShader = R_RemapShader;
01213 re.GetEntityToken = R_GetEntityToken;
01214 re.inPVS = R_inPVS;
01215
01216 return &re;
01217 }
|
Here is the call graph for this function:

|
|
Definition at line 758 of file tr_init.c. References glconfig_t::colorBits, refimport_t::Cvar_Get, cvar_t, glconfig_t::depthBits, glconfig_t::deviceSupportsGamma, glconfig_t::displayFrequency, glconfig_t::extensions_string, glConfig, glconfig_t::hardwareType, cvar_s::integer, glconfig_t::maxActiveTextures, glconfig_t::maxTextureSize, trGlobals_t::overbrightBits, PRINT_ALL, qglActiveTextureARB, qglLockArraysEXT, r_finish, r_fullscreen, r_mode, r_picmip, r_primitives, r_texturebits, r_textureMode, r_vertexLight, glconfig_t::renderer_string, ri, glconfig_t::smpActive, glconfig_t::stencilBits, cvar_s::string, TC_NONE, glconfig_t::textureCompression, glconfig_t::textureEnvAddAvailable, tr, glconfig_t::vendor_string, glconfig_t::version_string, glconfig_t::vidHeight, and glconfig_t::vidWidth. Referenced by InitOpenGL(), and R_Register(). 00759 {
00760 cvar_t *sys_cpustring = ri.Cvar_Get( "sys_cpustring", "", 0 );
00761 const char *enablestrings[] =
00762 {
00763 "disabled",
00764 "enabled"
00765 };
00766 const char *fsstrings[] =
00767 {
00768 "windowed",
00769 "fullscreen"
00770 };
00771
00772 ri.Printf( PRINT_ALL, "\nGL_VENDOR: %s\n", glConfig.vendor_string );
00773 ri.Printf( PRINT_ALL, "GL_RENDERER: %s\n", glConfig.renderer_string );
00774 ri.Printf( PRINT_ALL, "GL_VERSION: %s\n", glConfig.version_string );
00775 ri.Printf( PRINT_ALL, "GL_EXTENSIONS: %s\n", glConfig.extensions_string );
00776 ri.Printf( PRINT_ALL, "GL_MAX_TEXTURE_SIZE: %d\n", glConfig.maxTextureSize );
00777 ri.Printf( PRINT_ALL, "GL_MAX_ACTIVE_TEXTURES_ARB: %d\n", glConfig.maxActiveTextures );
00778 ri.Printf( PRINT_ALL, "\nPIXELFORMAT: color(%d-bits) Z(%d-bit) stencil(%d-bits)\n", glConfig.colorBits, glConfig.depthBits, glConfig.stencilBits );
00779 ri.Printf( PRINT_ALL, "MODE: %d, %d x %d %s hz:", r_mode->integer, glConfig.vidWidth, glConfig.vidHeight, fsstrings[r_fullscreen->integer == 1] );
00780 if ( glConfig.displayFrequency )
00781 {
00782 ri.Printf( PRINT_ALL, "%d\n", glConfig.displayFrequency );
00783 }
00784 else
00785 {
00786 ri.Printf( PRINT_ALL, "N/A\n" );
00787 }
00788 if ( glConfig.deviceSupportsGamma )
00789 {
00790 ri.Printf( PRINT_ALL, "GAMMA: hardware w/ %d overbright bits\n", tr.overbrightBits );
00791 }
00792 else
00793 {
00794 ri.Printf( PRINT_ALL, "GAMMA: software w/ %d overbright bits\n", tr.overbrightBits );
00795 }
00796 ri.Printf( PRINT_ALL, "CPU: %s\n", sys_cpustring->string );
00797
00798 // rendering primitives
00799 {
00800 int primitives;
00801
00802 // default is to use triangles if compiled vertex arrays are present
00803 ri.Printf( PRINT_ALL, "rendering primitives: " );
00804 primitives = r_primitives->integer;
00805 if ( primitives == 0 ) {
00806 if ( qglLockArraysEXT ) {
00807 primitives = 2;
00808 } else {
00809 primitives = 1;
00810 }
00811 }
00812 if ( primitives == -1 ) {
00813 ri.Printf( PRINT_ALL, "none\n" );
00814 } else if ( primitives == 2 ) {
00815 ri.Printf( PRINT_ALL, "single glDrawElements\n" );
00816 } else if ( primitives == 1 ) {
00817 ri.Printf( PRINT_ALL, "multiple glArrayElement\n" );
00818 } else if ( primitives == 3 ) {
00819 ri.Printf( PRINT_ALL, "multiple glColor4ubv + glTexCoord2fv + glVertex3fv\n" );
00820 }
00821 }
00822
00823 ri.Printf( PRINT_ALL, "texturemode: %s\n", r_textureMode->string );
00824 ri.Printf( PRINT_ALL, "picmip: %d\n", r_picmip->integer );
00825 ri.Printf( PRINT_ALL, "texture bits: %d\n", r_texturebits->integer );
00826 ri.Printf( PRINT_ALL, "multitexture: %s\n", enablestrings[qglActiveTextureARB != 0] );
00827 ri.Printf( PRINT_ALL, "compiled vertex arrays: %s\n", enablestrings[qglLockArraysEXT != 0 ] );
00828 ri.Printf( PRINT_ALL, "texenv add: %s\n", enablestrings[glConfig.textureEnvAddAvailable != 0] );
00829 ri.Printf( PRINT_ALL, "compressed textures: %s\n", enablestrings[glConfig.textureCompression!=TC_NONE] );
00830 if ( r_vertexLight->integer || glConfig.hardwareType == GLHW_PERMEDIA2 )
00831 {
00832 ri.Printf( PRINT_ALL, "HACK: using vertex lightmap approximation\n" );
00833 }
00834 if ( glConfig.hardwareType == GLHW_RAGEPRO )
00835 {
00836 ri.Printf( PRINT_ALL, "HACK: ragePro approximations\n" );
00837 }
00838 if ( glConfig.hardwareType == GLHW_RIVA128 )
00839 {
00840 ri.Printf( PRINT_ALL, "HACK: riva128 approximations\n" );
00841 }
00842 if ( glConfig.smpActive ) {
00843 ri.Printf( PRINT_ALL, "Using dual processor acceleration\n" );
00844 }
00845 if ( r_finish->integer ) {
00846 ri.Printf( PRINT_ALL, "Forcing glFinish\n" );
00847 }
00848 }
|
|
|
Definition at line 241 of file tr_init.c. References Com_sprintf(), err(), ERR_FATAL, cvar_s::integer, qglGetError, r_ignoreGLErrors, ri, s, and strcpy(). Referenced by Upload32(). 00241 {
00242 int err;
00243 char s[64];
00244
00245 err = qglGetError();
00246 if ( err == GL_NO_ERROR ) {
00247 return;
00248 }
00249 if ( r_ignoreGLErrors->integer ) {
00250 return;
00251 }
00252 switch( err ) {
00253 case GL_INVALID_ENUM:
00254 strcpy( s, "GL_INVALID_ENUM" );
00255 break;
00256 case GL_INVALID_VALUE:
00257 strcpy( s, "GL_INVALID_VALUE" );
00258 break;
00259 case GL_INVALID_OPERATION:
00260 strcpy( s, "GL_INVALID_OPERATION" );
00261 break;
00262 case GL_STACK_OVERFLOW:
00263 strcpy( s, "GL_STACK_OVERFLOW" );
00264 break;
00265 case GL_STACK_UNDERFLOW:
00266 strcpy( s, "GL_STACK_UNDERFLOW" );
00267 break;
00268 case GL_OUT_OF_MEMORY:
00269 strcpy( s, "GL_OUT_OF_MEMORY" );
00270 break;
00271 default:
00272 Com_sprintf( s, sizeof(s), "%i", err);
00273 break;
00274 }
00275
00276 ri.Error( ERR_FATAL, "GL_CheckErrors: %s", s );
00277 }
|
Here is the call graph for this function:

|
|
Definition at line 710 of file tr_init.c. References f, GL_SelectTexture(), GL_TexEnv(), GL_TextureMode(), GLS_DEPTHTEST_DISABLE, glState, glstate_t::glStateBits, qglClearDepth, qglColor4f, qglCullFace, qglDepthFunc, qglDepthMask, qglDisable, qglEnable, qglEnableClientState, qglPolygonMode, qglShadeModel, r_textureMode, and cvar_s::string. Referenced by InitOpenGL(). 00711 {
00712 qglClearDepth( 1.0f );
00713
00714 qglCullFace(GL_FRONT);
00715
00716 qglColor4f (1,1,1,1);
00717
00718 // initialize downstream texture unit if we're running
00719 // in a multitexture environment
00720 if ( qglActiveTextureARB ) {
00721 GL_SelectTexture( 1 );
00722 GL_TextureMode( r_textureMode->string );
00723 GL_TexEnv( GL_MODULATE );
00724 qglDisable( GL_TEXTURE_2D );
00725 GL_SelectTexture( 0 );
00726 }
00727
00728 qglEnable(GL_TEXTURE_2D);
00729 GL_TextureMode( r_textureMode->string );
00730 GL_TexEnv( GL_MODULATE );
00731
00732 qglShadeModel( GL_SMOOTH );
00733 qglDepthFunc( GL_LEQUAL );
00734
00735 // the vertex array is always enabled, but the color and texture
00736 // arrays are enabled and disabled around the compiled vertex array call
00737 qglEnableClientState (GL_VERTEX_ARRAY);
00738
00739 //
00740 // make sure our GL state vector is set correctly
00741 //
00742 glState.glStateBits = GLS_DEPTHTEST_DISABLE | GLS_DEPTHMASK_TRUE;
00743
00744 qglPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
00745 qglDepthMask( GL_TRUE );
00746 qglDisable( GL_DEPTH_TEST );
00747 qglEnable( GL_SCISSOR_TEST );
00748 qglDisable( GL_CULL_FACE );
00749 qglDisable( GL_BLEND );
00750 }
|
Here is the call graph for this function:

|
|
Definition at line 190 of file tr_init.c. References GfxInfo_f(), GL_SetDefaultState(), glConfig, GLimp_Init(), GLint, glconfig_t::maxTextureSize, Q_strlwr(), qglGetIntegerv, R_InitCommandBuffers(), glconfig_t::renderer_string, strcpy(), and glconfig_t::vidWidth. Referenced by R_Init(). 00191 {
00192 char renderer_buffer[1024];
00193
00194 //
00195 // initialize OS specific portions of the renderer
00196 //
00197 // GLimp_Init directly or indirectly references the following cvars:
00198 // - r_fullscreen
00199 // - r_glDriver
00200 // - r_mode
00201 // - r_(color|depth|stencil)bits
00202 // - r_ignorehwgamma
00203 // - r_gamma
00204 //
00205
00206 if ( glConfig.vidWidth == 0 )
00207 {
00208 GLint temp;
00209
00210 GLimp_Init();
00211
00212 strcpy( renderer_buffer, glConfig.renderer_string );
00213 Q_strlwr( renderer_buffer );
00214
00215 // OpenGL driver constants
00216 qglGetIntegerv( GL_MAX_TEXTURE_SIZE, &temp );
00217 glConfig.maxTextureSize = temp;
00218
00219 // stubbed or broken drivers may have reported 0...
00220 if ( glConfig.maxTextureSize <= 0 )
00221 {
00222 glConfig.maxTextureSize = 0;
00223 }
00224 }
00225
00226 // init command buffers and SMP
00227 R_InitCommandBuffers();
00228
00229 // print info
00230 GfxInfo_f();
00231
00232 // set default state
00233 GL_SetDefaultState();
00234 }
|
Here is the call graph for this function:

|
||||||||||||||||||||
|
Definition at line 307 of file tr_init.c. References height, vidmode_s::height, cvar_s::integer, mode, vidmode_s::pixelAspect, qboolean, r_customaspect, r_customheight, r_customwidth, r_vidModes, cvar_s::value, vidmode_t, width, and vidmode_s::width. Referenced by CreateGameWindow(), and GLW_SetMode(). 00307 {
00308 vidmode_t *vm;
00309
00310 if ( mode < -1 ) {
00311 return qfalse;
00312 }
00313 if ( mode >= s_numVidModes ) {
00314 return qfalse;
00315 }
00316
00317 if ( mode == -1 ) {
00318 *width = r_customwidth->integer;
00319 *height = r_customheight->integer;
00320 *windowAspect = r_customaspect->value;
00321 return qtrue;
00322 }
00323
00324 vm = &r_vidModes[mode];
00325
00326 *width = vm->width;
00327 *height = vm->height;
00328 *windowAspect = (float)vm->width / ( vm->height * vm->pixelAspect );
00329
00330 return qtrue;
00331 }
|
|
|
Definition at line 1013 of file tr_init.c. References backEnd, backEndData, byte, Com_Memset(), Com_Printf(), shaderCommands_s::constantColor255, DEG2RAD, err(), f, FUNCTABLE_SIZE, h_low, refimport_t::Hunk_Alloc, i, InitOpenGL(), cvar_s::integer, trGlobals_t::inverseSawToothTable, max_polys, max_polyverts, backEndData_t::polys, backEndData_t::polyVerts, PRINT_ALL, ptr(), qglGetError, R_InitFogTable(), R_InitFreeType(), R_InitImages(), R_InitShaders(), R_InitSkins(), r_maxpolys, r_maxpolyverts, R_ModelInit(), R_NoiseInit(), R_Register(), r_smp, R_ToggleSmpFrame(), ri, trGlobals_t::sawToothTable, sin(), trGlobals_t::sinTable, trGlobals_t::squareTable, srfPoly_t, tess, tr, trGlobals_t::triangleTable, and shaderCommands_s::xyz. Referenced by RE_BeginRegistration(). 01013 {
01014 int err;
01015 int i;
01016 byte *ptr;
01017
01018 ri.Printf( PRINT_ALL, "----- R_Init -----\n" );
01019
01020 // clear all our internal state
01021 Com_Memset( &tr, 0, sizeof( tr ) );
01022 Com_Memset( &backEnd, 0, sizeof( backEnd ) );
01023 Com_Memset( &tess, 0, sizeof( tess ) );
01024
01025 // Swap_Init();
01026
01027 if ( (int)tess.xyz & 15 ) {
01028 Com_Printf( "WARNING: tess.xyz not 16 byte aligned\n" );
01029 }
01030 Com_Memset( tess.constantColor255, 255, sizeof( tess.constantColor255 ) );
01031
01032 //
01033 // init function tables
01034 //
01035 for ( i = 0; i < FUNCTABLE_SIZE; i++ )
01036 {
01037 tr.sinTable[i] = sin( DEG2RAD( i * 360.0f / ( ( float ) ( FUNCTABLE_SIZE - 1 ) ) ) );
01038 tr.squareTable[i] = ( i < FUNCTABLE_SIZE/2 ) ? 1.0f : -1.0f;
01039 tr.sawToothTable[i] = (float)i / FUNCTABLE_SIZE;
01040 tr.inverseSawToothTable[i] = 1.0f - tr.sawToothTable[i];
01041
01042 if ( i < FUNCTABLE_SIZE / 2 )
01043 {
01044 if ( i < FUNCTABLE_SIZE / 4 )
01045 {
01046 tr.triangleTable[i] = ( float ) i / ( FUNCTABLE_SIZE / 4 );
01047 }
01048 else
01049 {
01050 tr.triangleTable[i] = 1.0f - tr.triangleTable[i-FUNCTABLE_SIZE / 4];
01051 }
01052 }
01053 else
01054 {
01055 tr.triangleTable[i] = -tr.triangleTable[i-FUNCTABLE_SIZE/2];
01056 }
01057 }
01058
01059 R_InitFogTable();
01060
01061 R_NoiseInit();
01062
01063 R_Register();
01064
01065 max_polys = r_maxpolys->integer;
01066 if (max_polys < MAX_POLYS)
01067 max_polys = MAX_POLYS;
01068
01069 max_polyverts = r_maxpolyverts->integer;
01070 if (max_polyverts < MAX_POLYVERTS)
01071 max_polyverts = MAX_POLYVERTS;
01072
01073 ptr = ri.Hunk_Alloc( sizeof( *backEndData[0] ) + sizeof(srfPoly_t) * max_polys + sizeof(polyVert_t) * max_polyverts, h_low);
01074 backEndData[0] = (backEndData_t *) ptr;
01075 backEndData[0]->polys = (srfPoly_t *) ((char *) ptr + sizeof( *backEndData[0] ));
01076 backEndData[0]->polyVerts = (polyVert_t *) ((char *) ptr + sizeof( *backEndData[0] ) + sizeof(srfPoly_t) * max_polys);
01077 if ( r_smp->integer ) {
01078 ptr = ri.Hunk_Alloc( sizeof( *backEndData[1] ) + sizeof(srfPoly_t) * max_polys + sizeof(polyVert_t) * max_polyverts, h_low);
01079 backEndData[1] = (backEndData_t *) ptr;
01080 backEndData[1]->polys = (srfPoly_t *) ((char *) ptr + sizeof( *backEndData[1] ));
01081 backEndData[1]->polyVerts = (polyVert_t *) ((char *) ptr + sizeof( *backEndData[1] ) + sizeof(srfPoly_t) * max_polys);
01082 } else {
01083 backEndData[1] = NULL;
01084 }
01085 R_ToggleSmpFrame();
01086
01087 InitOpenGL();
01088
01089 R_InitImages();
01090
01091 R_InitShaders();
01092
01093 R_InitSkins();
01094
01095 R_ModelInit();
01096
01097 R_InitFreeType();
01098
01099
01100 err = qglGetError();
01101 if ( err != GL_NO_ERROR )
01102 ri.Printf (PRINT_ALL, "glGetError() = 0x%x\n", err);
01103
01104 ri.Printf( PRINT_ALL, "----- finished R_Init -----\n" );
01105 }
|
Here is the call graph for this function:

|
|
Definition at line 530 of file tr_init.c. References b, world_t::baseName, buffer, byte, Com_Memset(), glconfig_t::deviceSupportsGamma, refimport_t::FS_WriteFile, g(), glConfig, refimport_t::Hunk_AllocateTempMemory, refimport_t::Hunk_FreeTempMemory, trGlobals_t::overbrightBits, PRINT_ALL, qglReadPixels, r, R_GammaCorrect(), ri, source, sprintf(), src, tr, glconfig_t::vidHeight, glconfig_t::vidWidth, trGlobals_t::world, x, xx, y, and yy. Referenced by R_ScreenShot_f(), and R_ScreenShotJPEG_f(). 00530 {
00531 char checkname[MAX_OSPATH];
00532 byte *buffer;
00533 byte *source;
00534 byte *src, *dst;
00535 int x, y;
00536 int r, g, b;
00537 float xScale, yScale;
00538 int xx, yy;
00539
00540 sprintf( checkname, "levelshots/%s.tga", tr.world->baseName );
00541
00542 source = ri.Hunk_AllocateTempMemory( glConfig.vidWidth * glConfig.vidHeight * 3 );
00543
00544 buffer = ri.Hunk_AllocateTempMemory( 128 * 128*3 + 18);
00545 Com_Memset (buffer, 0, 18);
00546 buffer[2] = 2; // uncompressed type
00547 buffer[12] = 128;
00548 buffer[14] = 128;
00549 buffer[16] = 24; // pixel size
00550
00551 qglReadPixels( 0, 0, glConfig.vidWidth, glConfig.vidHeight, GL_RGB, GL_UNSIGNED_BYTE, source );
00552
00553 // resample from source
00554 xScale = glConfig.vidWidth / 512.0f;
00555 yScale = glConfig.vidHeight / 384.0f;
00556 for ( y = 0 ; y < 128 ; y++ ) {
00557 for ( x = 0 ; x < 128 ; x++ ) {
00558 r = g = b = 0;
00559 for ( yy = 0 ; yy < 3 ; yy++ ) {
00560 for ( xx = 0 ; xx < 4 ; xx++ ) {
00561 src = source + 3 * ( glConfig.vidWidth * (int)( (y*3+yy)*yScale ) + (int)( (x*4+xx)*xScale ) );
00562 r += src[0];
00563 g += src[1];
00564 b += src[2];
00565 }
00566 }
00567 dst = buffer + 18 + 3 * ( y * 128 + x );
00568 dst[0] = b / 12;
00569 dst[1] = g / 12;
00570 dst[2] = r / 12;
00571 }
00572 }
00573
00574 // gamma correct
00575 if ( ( tr.overbrightBits > 0 ) && glConfig.deviceSupportsGamma ) {
00576 R_GammaCorrect( buffer + 18, 128 * 128 * 3 );
00577 }
00578
00579 ri.FS_WriteFile( checkname, buffer, 128 * 128*3 + 18 );
00580
00581 ri.Hunk_FreeTempMemory( buffer );
00582 ri.Hunk_FreeTempMemory( source );
00583
00584 ri.Printf( PRINT_ALL, "Wrote %s\n", checkname );
00585 }
|
Here is the call graph for this function:

|
|
Definition at line 336 of file tr_init.c. References i, PRINT_ALL, r_vidModes, and ri. Referenced by R_Register(). 00337 {
00338 int i;
00339
00340 ri.Printf( PRINT_ALL, "\n" );
00341 for ( i = 0; i < s_numVidModes; i++ )
00342 {
00343 ri.Printf( PRINT_ALL, "%s\n", r_vidModes[i].description );
00344 }
00345 ri.Printf( PRINT_ALL, "\n" );
00346 }
|
|
|
Definition at line 855 of file tr_init.c. References AssertCvarRange(), refimport_t::Cmd_AddCommand, CVAR_ARCHIVE, CVAR_CHEAT, refimport_t::Cvar_Get, CVAR_LATCH, CVAR_TEMP, f, GfxInfo_f(), MAX_POLYS, MAX_POLYVERTS, OPENGL_DRIVER_NAME, qtrue, r_allowExtensions, r_ambientScale, r_clear, r_colorbits, r_colorMipLevels, r_customaspect, r_customheight, r_customwidth, r_debugLight, r_debugSort, r_debugSurface, r_depthbits, r_detailTextures, r_directedScale, r_displayRefresh, r_dlightBacks, r_drawBuffer, r_drawentities, r_drawSun, r_drawworld, r_dynamiclight, r_ext_compiled_vertex_array, r_ext_compressed_textures, r_ext_gamma_control, r_ext_multitexture, r_ext_texture_env_add, r_facePlaneCull, r_fastsky, r_finish, r_flareFade, r_flares, r_flareSize, r_fullbright, r_fullscreen, r_gamma, r_glDriver, r_ignore, r_ignoreFastPath, r_ignoreGLErrors, r_ignorehwgamma, R_ImageList_f(), r_inGameVideo, r_intensity, r_lightmap, r_lockpvs, r_lodbias, r_lodCurveError, r_lodscale, r_logFile, r_mapOverBrightBits, r_maxpolys, r_maxpolyverts, r_measureOverdraw, r_mode, R_ModeList_f(), R_Modellist_f(), r_nobind, r_nocull, r_nocurves, r_noportals, r_norefresh, r_novis, r_offsetFactor, r_offsetUnits, r_overBrightBits, r_picmip, r_portalOnly, r_primitives, r_printShaders, r_railCoreWidth, r_railSegmentLength, r_railWidth, r_roundImagesDown, r_saveFontData, R_ScreenShot_f(), R_ScreenShotJPEG_f(), R_ShaderList_f(), r_shadows, r_showcluster, r_showImages, r_shownormals, r_showsky, r_showSmp, r_showtris, r_simpleMipMaps, r_singleShader, R_SkinList_f(), r_skipBackEnd, r_smp, r_speeds, r_stencilbits, r_stereo, r_subdivisions, r_swapInterval, r_texturebits, r_textureMode, r_uiFullScreen, r_verbose, r_vertexLight, r_znear, ri, Sys_ProcessorCount(), and va(). Referenced by R_Init(). 00856 {
00857 //
00858 // latched and archived variables
00859 //
00860 r_glDriver = ri.Cvar_Get( "r_glDriver", OPENGL_DRIVER_NAME, CVAR_ARCHIVE | CVAR_LATCH );
00861 r_allowExtensions = ri.Cvar_Get( "r_allowExtensions", "1", CVAR_ARCHIVE | CVAR_LATCH );
00862 r_ext_compressed_textures = ri.Cvar_Get( "r_ext_compressed_textures", "0", CVAR_ARCHIVE | CVAR_LATCH );
00863 r_ext_gamma_control = ri.Cvar_Get( "r_ext_gamma_control", "1", CVAR_ARCHIVE | CVAR_LATCH );
00864 r_ext_multitexture = ri.Cvar_Get( "r_ext_multitexture", "1", CVAR_ARCHIVE | CVAR_LATCH );
00865 r_ext_compiled_vertex_array = ri.Cvar_Get( "r_ext_compiled_vertex_array", "1", CVAR_ARCHIVE | CVAR_LATCH);
00866 #ifdef __linux__ // broken on linux
00867 r_ext_texture_env_add = ri.Cvar_Get( "r_ext_texture_env_add", "0", CVAR_ARCHIVE | CVAR_LATCH);
00868 #else
00869 r_ext_texture_env_add = ri.Cvar_Get( "r_ext_texture_env_add", "1", CVAR_ARCHIVE | CVAR_LATCH);
00870 #endif
00871
00872 r_picmip = ri.Cvar_Get ("r_picmip", "1", CVAR_ARCHIVE | CVAR_LATCH );
00873 r_roundImagesDown = ri.Cvar_Get ("r_roundImagesDown", "1", CVAR_ARCHIVE | CVAR_LATCH );
00874 r_colorMipLevels = ri.Cvar_Get ("r_colorMipLevels", "0", CVAR_LATCH );
00875 AssertCvarRange( r_picmip, 0, 16, qtrue );
00876 r_detailTextures = ri.Cvar_Get( "r_detailtextures", "1", CVAR_ARCHIVE | CVAR_LATCH );
00877 r_texturebits = ri.Cvar_Get( "r_texturebits", "0", CVAR_ARCHIVE | CVAR_LATCH );
00878 r_colorbits = ri.Cvar_Get( "r_colorbits", "0", CVAR_ARCHIVE | CVAR_LATCH );
00879 r_stereo = ri.Cvar_Get( "r_stereo", "0", CVAR_ARCHIVE | CVAR_LATCH );
00880 #ifdef __linux__
00881 r_stencilbits = ri.Cvar_Get( "r_stencilbits", "0", CVAR_ARCHIVE | CVAR_LATCH );
00882 #else
00883 r_stencilbits = ri.Cvar_Get( "r_stencilbits", "8", CVAR_ARCHIVE | CVAR_LATCH );
00884 #endif
00885 r_depthbits = ri.Cvar_Get( "r_depthbits", "0", CVAR_ARCHIVE | CVAR_LATCH );
00886 r_overBrightBits = ri.Cvar_Get ("r_overBrightBits", "1", CVAR_ARCHIVE | CVAR_LATCH );
00887 r_ignorehwgamma = ri.Cvar_Get( "r_ignorehwgamma", "0", CVAR_ARCHIVE | CVAR_LATCH);
00888 r_mode = ri.Cvar_Get( "r_mode", "3", CVAR_ARCHIVE | CVAR_LATCH );
00889 r_fullscreen = ri.Cvar_Get( "r_fullscreen", "1", CVAR_ARCHIVE | CVAR_LATCH );
00890 r_customwidth = ri.Cvar_Get( "r_customwidth", "1600", CVAR_ARCHIVE | CVAR_LATCH );
00891 r_customheight = ri.Cvar_Get( "r_customheight", "1024", CVAR_ARCHIVE | CVAR_LATCH );
00892 r_customaspect = ri.Cvar_Get( "r_customaspect", "1", CVAR_ARCHIVE | CVAR_LATCH );
00893 r_simpleMipMaps = ri.Cvar_Get( "r_simpleMipMaps", "1", CVAR_ARCHIVE | CVAR_LATCH );
00894 r_vertexLight = ri.Cvar_Get( "r_vertexLight", "0", CVAR_ARCHIVE | CVAR_LATCH );
00895 r_uiFullScreen = ri.Cvar_Get( "r_uifullscreen", "0", 0);
00896 r_subdivisions = ri.Cvar_Get ("r_subdivisions", "4", CVAR_ARCHIVE | CVAR_LATCH);
00897 #if (defined(MACOS_X) || defined(__linux__)) && defined(SMP)
00898 // Default to using SMP on Mac OS X or Linux if we have multiple processors
00899 r_smp = ri.Cvar_Get( "r_smp", Sys_ProcessorCount() > 1 ? "1" : "0", CVAR_ARCHIVE | CVAR_LATCH);
00900 #else
00901 r_smp = ri.Cvar_Get( "r_smp", "0", CVAR_ARCHIVE | CVAR_LATCH);
00902 #endif
00903 r_ignoreFastPath = ri.Cvar_Get( "r_ignoreFastPath", "1", CVAR_ARCHIVE | CVAR_LATCH );
00904
00905 //
00906 // temporary latched variables that can only change over a restart
00907 //
00908 r_displayRefresh = ri.Cvar_Get( "r_displayRefresh", "0", CVAR_LATCH );
00909 AssertCvarRange( r_displayRefresh, 0, 200, qtrue );
00910 r_fullbright = ri.Cvar_Get ("r_fullbright", "0", CVAR_LATCH|CVAR_CHEAT );
00911 r_mapOverBrightBits = ri.Cvar_Get ("r_mapOverBrightBits", "2", CVAR_LATCH );
00912 r_intensity = ri.Cvar_Get ("r_intensity", "1", CVAR_LATCH );
00913 r_singleShader = ri.Cvar_Get ("r_singleShader", "0", CVAR_CHEAT | CVAR_LATCH );
00914
00915 //
00916 // archived variables that can change at any time
00917 //
00918 r_lodCurveError = ri.Cvar_Get( "r_lodCurveError", "250", CVAR_ARCHIVE|CVAR_CHEAT );
00919 r_lodbias = ri.Cvar_Get( "r_lodbias", "0", CVAR_ARCHIVE );
00920 r_flares = ri.Cvar_Get ("r_flares", "0", CVAR_ARCHIVE );
00921 r_znear = ri.Cvar_Get( "r_znear", "4", CVAR_CHEAT );
00922 AssertCvarRange( r_znear, 0.001f, 200, qtrue );
00923 r_ignoreGLErrors = ri.Cvar_Get( "r_ignoreGLErrors", "1", CVAR_ARCHIVE );
00924 r_fastsky = ri.Cvar_Get( "r_fastsky", "0", CVAR_ARCHIVE );
00925 r_inGameVideo = ri.Cvar_Get( "r_inGameVideo", "1", CVAR_ARCHIVE );
00926 r_drawSun = ri.Cvar_Get( "r_drawSun", "0", CVAR_ARCHIVE );
00927 r_dynamiclight = ri.Cvar_Get( "r_dynamiclight", "1", CVAR_ARCHIVE );
00928 r_dlightBacks = ri.Cvar_Get( "r_dlightBacks", "1", CVAR_ARCHIVE );
00929 r_finish = ri.Cvar_Get ("r_finish", "0", CVAR_ARCHIVE);
00930 r_textureMode = ri.Cvar_Get( "r_textureMode", "GL_LINEAR_MIPMAP_NEAREST", CVAR_ARCHIVE );
00931 r_swapInterval = ri.Cvar_Get( "r_swapInterval", "0", CVAR_ARCHIVE );
00932 #ifdef __MACOS__
00933 r_gamma = ri.Cvar_Get( "r_gamma", "1.2", CVAR_ARCHIVE );
00934 #else
00935 r_gamma = ri.Cvar_Get( "r_gamma", "1", CVAR_ARCHIVE );
00936 #endif
00937 r_facePlaneCull = ri.Cvar_Get ("r_facePlaneCull", "1", CVAR_ARCHIVE );
00938
00939 r_railWidth = ri.Cvar_Get( "r_railWidth", "16", CVAR_ARCHIVE );
00940 r_railCoreWidth = ri.Cvar_Get( "r_railCoreWidth", "6", CVAR_ARCHIVE );
00941 r_railSegmentLength = ri.Cvar_Get( "r_railSegmentLength", "32", CVAR_ARCHIVE );
00942
00943 r_primitives = ri.Cvar_Get( "r_primitives", "0", CVAR_ARCHIVE );
00944
00945 r_ambientScale = ri.Cvar_Get( "r_ambientScale", "0.6", CVAR_CHEAT );
00946 r_directedScale = ri.Cvar_Get( "r_directedScale", "1", CVAR_CHEAT );
00947
00948 //
00949 // temporary variables that can change at any time
00950 //
00951 r_showImages = ri.Cvar_Get( "r_showImages", "0", CVAR_TEMP );
00952
00953 r_debugLight = ri.Cvar_Get( "r_debuglight", "0", CVAR_TEMP );
00954 r_debugSort = ri.Cvar_Get( "r_debugSort", "0", CVAR_CHEAT );
00955 r_printShaders = ri.Cvar_Get( "r_printShaders", "0", 0 );
00956 r_saveFontData = ri.Cvar_Get( "r_saveFontData", "0", 0 );
00957
00958 r_nocurves = ri.Cvar_Get ("r_nocurves", "0", CVAR_CHEAT );
00959 r_drawworld = ri.Cvar_Get ("r_drawworld", "1", CVAR_CHEAT );
00960 r_lightmap = ri.Cvar_Get ("r_lightmap", "0", 0 );
00961 r_portalOnly = ri.Cvar_Get ("r_portalOnly", "0", CVAR_CHEAT );
00962
00963 r_flareSize = ri.Cvar_Get ("r_flareSize", "40", CVAR_CHEAT);
00964 r_flareFade = ri.Cvar_Get ("r_flareFade", "7", CVAR_CHEAT);
00965
00966 r_showSmp = ri.Cvar_Get ("r_showSmp", "0", CVAR_CHEAT);
00967 r_skipBackEnd = ri.Cvar_Get ("r_skipBackEnd", "0", CVAR_CHEAT);
00968
00969 r_measureOverdraw = ri.Cvar_Get( "r_measureOverdraw", "0", CVAR_CHEAT );
00970 r_lodscale = ri.Cvar_Get( "r_lodscale", "5", CVAR_CHEAT );
00971 r_norefresh = ri.Cvar_Get ("r_norefresh", "0", CVAR_CHEAT);
00972 r_drawentities = ri.Cvar_Get ("r_drawentities", "1", CVAR_CHEAT );
00973 r_ignore = ri.Cvar_Get( "r_ignore", "1", CVAR_CHEAT );
00974 r_nocull = ri.Cvar_Get ("r_nocull", "0", CVAR_CHEAT);
00975 r_novis = ri.Cvar_Get ("r_novis", "0", CVAR_CHEAT);
00976 r_showcluster = ri.Cvar_Get ("r_showcluster", "0", CVAR_CHEAT);
00977 r_speeds = ri.Cvar_Get ("r_speeds", "0", CVAR_CHEAT);
00978 r_verbose = ri.Cvar_Get( "r_verbose", "0", CVAR_CHEAT );
00979 r_logFile = ri.Cvar_Get( "r_logFile", "0", CVAR_CHEAT );
00980 r_debugSurface = ri.Cvar_Get ("r_debugSurface", "0", CVAR_CHEAT);
00981 r_nobind = ri.Cvar_Get ("r_nobind", "0", CVAR_CHEAT);
00982 r_showtris = ri.Cvar_Get ("r_showtris", "0", CVAR_CHEAT);
00983 r_showsky = ri.Cvar_Get ("r_showsky", "0", CVAR_CHEAT);
00984 r_shownormals = ri.Cvar_Get ("r_shownormals", "0", CVAR_CHEAT);
00985 r_clear = ri.Cvar_Get ("r_clear", "0", CVAR_CHEAT);
00986 r_offsetFactor = ri.Cvar_Get( "r_offsetfactor", "-1", CVAR_CHEAT );
00987 r_offsetUnits = ri.Cvar_Get( "r_offsetunits", "-2", CVAR_CHEAT );
00988 r_drawBuffer = ri.Cvar_Get( "r_drawBuffer", "GL_BACK", CVAR_CHEAT );
00989 r_lockpvs = ri.Cvar_Get ("r_lockpvs", "0", CVAR_CHEAT);
00990 r_noportals = ri.Cvar_Get ("r_noportals", "0", CVAR_CHEAT);
00991 r_shadows = ri.Cvar_Get( "cg_shadows", "1", 0 );
00992
00993 r_maxpolys = ri.Cvar_Get( "r_maxpolys", va("%d", MAX_POLYS), 0);
00994 r_maxpolyverts = ri.Cvar_Get( "r_maxpolyverts", va("%d", MAX_POLYVERTS), 0);
00995
00996 // make sure all the commands added here are also
00997 // removed in R_Shutdown
00998 ri.Cmd_AddCommand( "imagelist", R_ImageList_f );
00999 ri.Cmd_AddCommand( "shaderlist", R_ShaderList_f );
01000 ri.Cmd_AddCommand( "skinlist", R_SkinList_f );
01001 ri.Cmd_AddCommand( "modellist", R_Modellist_f );
01002 ri.Cmd_AddCommand( "modelist", R_ModeList_f );
01003 ri.Cmd_AddCommand( "screenshot", R_ScreenShot_f );
01004 ri.Cmd_AddCommand( "screenshotJPEG", R_ScreenShotJPEG_f );
01005 ri.Cmd_AddCommand( "gfxinfo", GfxInfo_f );
01006 }
|
Here is the call graph for this function:

|
|
Definition at line 599 of file tr_init.c. References refimport_t::Cmd_Argc, refimport_t::Cmd_Argv, Com_sprintf(), refimport_t::FS_FileExists, glConfig, MAX_OSPATH, PRINT_ALL, qboolean, qfalse, R_LevelShot(), R_ScreenshotFilename(), R_TakeScreenshot(), ri, strcmp(), glconfig_t::vidHeight, and glconfig_t::vidWidth. Referenced by R_Register(). 00599 {
00600 char checkname[MAX_OSPATH];
00601 static int lastNumber = -1;
00602 qboolean silent;
00603
00604 if ( !strcmp( ri.Cmd_Argv(1), "levelshot" ) ) {
00605 R_LevelShot();
00606 return;
00607 }
00608
00609 if ( !strcmp( ri.Cmd_Argv(1), "silent" ) ) {
00610 silent = qtrue;
00611 } else {
00612 silent = qfalse;
00613 }
00614
00615 if ( ri.Cmd_Argc() == 2 && !silent ) {
00616 // explicit filename
00617 Com_sprintf( checkname, MAX_OSPATH, "screenshots/%s.tga", ri.Cmd_Argv( 1 ) );
00618 } else {
00619 // scan for a free filename
00620
00621 // if we have saved a previous screenshot, don't scan
00622 // again, because recording demo avis can involve
00623 // thousands of shots
00624 if ( lastNumber == -1 ) {
00625 lastNumber = 0;
00626 }
00627 // scan for a free number
00628 for ( ; lastNumber <= 9999 ; lastNumber++ ) {
00629 R_ScreenshotFilename( lastNumber, checkname );
00630
00631 if (!ri.FS_FileExists( checkname ))
00632 {
00633 break; // file doesn't exist
00634 }
00635 }
00636
00637 if ( lastNumber >= 9999 ) {
00638 ri.Printf (PRINT_ALL, "ScreenShot: Couldn't create a file\n");
00639 return;
00640 }
00641
00642 lastNumber++;
00643 }
00644
00645 R_TakeScreenshot( 0, 0, glConfig.vidWidth, glConfig.vidHeight, checkname, qfalse );
00646
00647 if ( !silent ) {
00648 ri.Printf (PRINT_ALL, "Wrote %s\n", checkname);
00649 }
00650 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 477 of file tr_init.c. References a, b, c, Com_sprintf(), d, and MAX_OSPATH. Referenced by R_ScreenShot_f(). 00477 {
00478 int a,b,c,d;
00479
00480 if ( lastNumber < 0 || lastNumber > 9999 ) {
00481 Com_sprintf( fileName, MAX_OSPATH, "screenshots/shot9999.tga" );
00482 return;
00483 }
00484
00485 a = lastNumber / 1000;
00486 lastNumber -= a*1000;
00487 b = lastNumber / 100;
00488 lastNumber -= b*100;
00489 c = lastNumber / 10;
00490 lastNumber -= c*10;
00491 d = lastNumber;
00492
00493 Com_sprintf( fileName, MAX_OSPATH, "screenshots/shot%i%i%i%i.tga"
00494 , a, b, c, d );
00495 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 502 of file tr_init.c. References a, b, c, Com_sprintf(), d, and MAX_OSPATH. Referenced by R_ScreenShotJPEG_f(). 00502 {
00503 int a,b,c,d;
00504
00505 if ( lastNumber < 0 || lastNumber > 9999 ) {
00506 Com_sprintf( fileName, MAX_OSPATH, "screenshots/shot9999.jpg" );
00507 return;
00508 }
00509
00510 a = lastNumber / 1000;
00511 lastNumber -= a*1000;
00512 b = lastNumber / 100;
00513 lastNumber -= b*100;
00514 c = lastNumber / 10;
00515 lastNumber -= c*10;
00516 d = lastNumber;
00517
00518 Com_sprintf( fileName, MAX_OSPATH, "screenshots/shot%i%i%i%i.jpg"
00519 , a, b, c, d );
00520 }
|
Here is the call graph for this function:

|
|
Definition at line 652 of file tr_init.c. References refimport_t::Cmd_Argc, refimport_t::Cmd_Argv, Com_sprintf(), refimport_t::FS_FileExists, glConfig, MAX_OSPATH, PRINT_ALL, qboolean, qtrue, R_LevelShot(), R_ScreenshotFilenameJPEG(), R_TakeScreenshot(), ri, strcmp(), glconfig_t::vidHeight, and glconfig_t::vidWidth. Referenced by R_Register(). 00652 {
00653 char checkname[MAX_OSPATH];
00654 static int lastNumber = -1;
00655 qboolean silent;
00656
00657 if ( !strcmp( ri.Cmd_Argv(1), "levelshot" ) ) {
00658 R_LevelShot();
00659 return;
00660 }
00661
00662 if ( !strcmp( ri.Cmd_Argv(1), "silent" ) ) {
00663 silent = qtrue;
00664 } else {
00665 silent = qfalse;
00666 }
00667
00668 if ( ri.Cmd_Argc() == 2 && !silent ) {
00669 // explicit filename
00670 Com_sprintf( checkname, MAX_OSPATH, "screenshots/%s.jpg", ri.Cmd_Argv( 1 ) );
00671 } else {
00672 // scan for a free filename
00673
00674 // if we have saved a previous screenshot, don't scan
00675 // again, because recording demo avis can involve
00676 // thousands of shots
00677 if ( lastNumber == -1 ) {
00678 lastNumber = 0;
00679 }
00680 // scan for a free number
00681 for ( ; lastNumber <= 9999 ; lastNumber++ ) {
00682 R_ScreenshotFilenameJPEG( lastNumber, checkname );
00683
00684 if (!ri.FS_FileExists( checkname ))
00685 {
00686 break; // file doesn't exist
00687 }
00688 }
00689
00690 if ( lastNumber == 10000 ) {
00691 ri.Printf (PRINT_ALL, "ScreenShot: Couldn't create a file\n");
00692 return;
00693 }
00694
00695 lastNumber++;
00696 }
00697
00698 R_TakeScreenshot( 0, 0, glConfig.vidWidth, glConfig.vidHeight, checkname, qtrue );
00699
00700 if ( !silent ) {
00701 ri.Printf (PRINT_ALL, "Wrote %s\n", checkname);
00702 }
00703 }
|
Here is the call graph for this function:

|
||||||||||||||||||||||||||||
|
Definition at line 453 of file tr_init.c. References screenshotCommand_t::commandId, screenshotCommand_t::fileName, screenshotCommand_t::height, screenshotCommand_t::jpeg, name, Q_strncpyz(), R_GetCommandBuffer(), screenshotCommand_t::width, screenshotCommand_t::x, and screenshotCommand_t::y. Referenced by R_ScreenShot_f(), and R_ScreenShotJPEG_f(). 00453 {
00454 static char fileName[MAX_OSPATH]; // bad things if two screenshots per frame?
00455 screenshotCommand_t *cmd;
00456
00457 cmd = R_GetCommandBuffer( sizeof( *cmd ) );
00458 if ( !cmd ) {
00459 return;
00460 }
00461 cmd->commandId = RC_SCREENSHOT;
00462
00463 cmd->x = x;
00464 cmd->y = y;
00465 cmd->width = width;
00466 cmd->height = height;
00467 Q_strncpyz( fileName, name, sizeof(fileName) );
00468 cmd->fileName = fileName;
00469 cmd->jpeg = jpeg;
00470 }
|
Here is the call graph for this function:

|
||||||||||||||||||||||||
|
Definition at line 373 of file tr_init.c. References buffer, byte, c, Com_Memset(), glconfig_t::deviceSupportsGamma, refimport_t::FS_WriteFile, glConfig, height, refimport_t::Hunk_AllocateTempMemory, refimport_t::Hunk_FreeTempMemory, i, trGlobals_t::overbrightBits, qglReadPixels, R_GammaCorrect(), ri, tr, glconfig_t::vidHeight, glconfig_t::vidWidth, width, x, and y. Referenced by RB_TakeScreenshotCmd(). 00373 {
00374 byte *buffer;
00375 int i, c, temp;
00376
00377 buffer = ri.Hunk_AllocateTempMemory(glConfig.vidWidth*glConfig.vidHeight*3+18);
00378
00379 Com_Memset (buffer, 0, 18);
00380 buffer[2] = 2; // uncompressed type
00381 buffer[12] = width & 255;
00382 buffer[13] = width >> 8;
00383 buffer[14] = height & 255;
00384 buffer[15] = height >> 8;
00385 buffer[16] = 24; // pixel size
00386
00387 qglReadPixels( x, y, width, height, GL_RGB, GL_UNSIGNED_BYTE, buffer+18 );
00388
00389 // swap rgb to bgr
00390 c = 18 + width * height * 3;
00391 for (i=18 ; i<c ; i+=3) {
00392 temp = buffer[i];
00393 buffer[i] = buffer[i+2];
00394 buffer[i+2] = temp;
00395 }
00396
00397 // gamma correct
00398 if ( ( tr.overbrightBits > 0 ) && glConfig.deviceSupportsGamma ) {
00399 R_GammaCorrect( buffer + 18, glConfig.vidWidth * glConfig.vidHeight * 3 );
00400 }
00401
00402 ri.FS_WriteFile( fileName, buffer, c );
00403
00404 ri.Hunk_FreeTempMemory( buffer );
00405 }
|
Here is the call graph for this function:

|
|
Definition at line 435 of file tr_init.c. References screenshotCommand_t::fileName, screenshotCommand_t::height, screenshotCommand_t::jpeg, RB_TakeScreenshot(), RB_TakeScreenshotJPEG(), screenshotCommand_t::width, screenshotCommand_t::x, and screenshotCommand_t::y. Referenced by RB_ExecuteRenderCommands(). 00435 {
00436 const screenshotCommand_t *cmd;
00437
00438 cmd = (const screenshotCommand_t *)data;
00439
00440 if (cmd->jpeg)
00441 RB_TakeScreenshotJPEG( cmd->x, cmd->y, cmd->width, cmd->height, cmd->fileName);
00442 else
00443 RB_TakeScreenshot( cmd->x, cmd->y, cmd->width, cmd->height, cmd->fileName);
00444
00445 return (const void *)(cmd + 1);
00446 }
|
Here is the call graph for this function:

|
||||||||||||||||||||||||
|
Definition at line 412 of file tr_init.c. References buffer, byte, glconfig_t::deviceSupportsGamma, refimport_t::FS_WriteFile, glConfig, height, refimport_t::Hunk_AllocateTempMemory, refimport_t::Hunk_FreeTempMemory, trGlobals_t::overbrightBits, qglReadPixels, R_GammaCorrect(), ri, SaveJPG(), tr, glconfig_t::vidHeight, glconfig_t::vidWidth, width, x, and y. Referenced by RB_TakeScreenshotCmd(). 00412 {
00413 byte *buffer;
00414
00415 buffer = ri.Hunk_AllocateTempMemory(glConfig.vidWidth*glConfig.vidHeight*4);
00416
00417 qglReadPixels( x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, buffer );
00418
00419 // gamma correct
00420 if ( ( tr.overbrightBits > 0 ) && glConfig.deviceSupportsGamma ) {
00421 R_GammaCorrect( buffer, glConfig.vidWidth * glConfig.vidHeight * 4 );
00422 }
00423
00424 ri.FS_WriteFile( fileName, buffer, 1 ); // create path
00425 SaveJPG( fileName, 95, glConfig.vidWidth, glConfig.vidHeight, buffer);
00426
00427 ri.Hunk_FreeTempMemory( buffer );
00428 }
|
Here is the call graph for this function:

|
|
Definition at line 1151 of file tr_init.c. References R_SyncRenderThread(), RB_ShowImages(), and Sys_LowPhysicalMemory(). 01151 {
01152 R_SyncRenderThread();
01153 if (!Sys_LowPhysicalMemory()) {
01154 RB_ShowImages();
01155 }
01156 }
|
Here is the call graph for this function:

|
|
Definition at line 1112 of file tr_init.c. References refimport_t::Cmd_RemoveCommand, GLimp_Shutdown(), PRINT_ALL, R_DeleteTextures(), R_DoneFreeType(), R_ShutdownCommandBuffers(), R_SyncRenderThread(), trGlobals_t::registered, ri, and tr. 01112 {
01113
01114 ri.Printf( PRINT_ALL, "RE_Shutdown( %i )\n", destroyWindow );
01115
01116 ri.Cmd_RemoveCommand ("modellist");
01117 ri.Cmd_RemoveCommand ("screenshotJPEG");
01118 ri.Cmd_RemoveCommand ("screenshot");
01119 ri.Cmd_RemoveCommand ("imagelist");
01120 ri.Cmd_RemoveCommand ("shaderlist");
01121 ri.Cmd_RemoveCommand ("skinlist");
01122 ri.Cmd_RemoveCommand ("gfxinfo");
01123 ri.Cmd_RemoveCommand( "modelist" );
01124 ri.Cmd_RemoveCommand( "shaderstate" );
01125
01126
01127 if ( tr.registered ) {
01128 R_SyncRenderThread();
01129 R_ShutdownCommandBuffers();
01130 R_DeleteTextures();
01131 }
01132
01133 R_DoneFreeType();
01134
01135 // shut down platform specific OpenGL stuff
01136 if ( destroyWindow ) {
01137 GLimp_Shutdown();
01138 }
01139
01140 tr.registered = qfalse;
01141 }
|
Here is the call graph for this function:

|
|
|
|
|
|
|
|
|
|
|
Definition at line 27 of file tr_init.c. Referenced by GL_Bind(), GL_BindMultitexture(), GL_Cull(), GL_SelectTexture(), GL_SetDefaultState(), GL_State(), GL_TexEnv(), GLimp_Shutdown(), R_ArrayElementDiscrete(), R_DeleteTextures(), RB_BeginDrawingView(), RB_SwapBuffers(), RB_TestFlare(), and RE_BeginFrame(). |
|
|
Definition at line 147 of file tr_init.c. Referenced by R_Init(). |
|
|
Definition at line 149 of file tr_init.c. Referenced by R_Init(), and RE_AddPolyToScene(). |
|
|
Definition at line 76 of file tr_init.c. Referenced by GLW_InitExtensions(), and R_Register(). |
|
|
Definition at line 139 of file tr_init.c. Referenced by R_Register(), and R_SetupEntityLightingGrid(). |
|
|
Definition at line 111 of file tr_init.c. Referenced by R_Register(), and RB_DrawBuffer(). |
|
|
Definition at line 89 of file tr_init.c. Referenced by GetPixelAttributes(), GLW_InitDriver(), GLW_LoadOpenGL(), GLW_SetMode(), R_Register(), and Sys_GetMatchingDisplayMode(). |
|
|
Definition at line 105 of file tr_init.c. Referenced by R_Register(), and Upload32(). |
|
|
Definition at line 129 of file tr_init.c. Referenced by R_GetModeInfo(), and R_Register(). |
|
|
Definition at line 128 of file tr_init.c. Referenced by R_GetModeInfo(), and R_Register(). |
|
|
Definition at line 127 of file tr_init.c. Referenced by R_GetModeInfo(), and R_Register(). |
|
|
Definition at line 141 of file tr_init.c. Referenced by R_Register(), and R_SetupEntityLighting(). |
|
|
Definition at line 142 of file tr_init.c. Referenced by R_Register(), and RB_EndSurface(). |
|
|
Definition at line 134 of file tr_init.c. Referenced by R_DebugGraphics(), and R_Register(). |
|
|
Definition at line 88 of file tr_init.c. Referenced by GetPixelAttributes(), GLW_InitDriver(), GLW_SetMode(), and R_Register(). |
|
|
Definition at line 45 of file tr_init.c. Referenced by FinishShader(), and R_Register(). |
|
|
Definition at line 140 of file tr_init.c. Referenced by R_Register(), and R_SetupEntityLightingGrid(). |
|
|
Definition at line 43 of file tr_init.c. Referenced by GLW_SetMode(), and R_Register(). |
|
|
Definition at line 60 of file tr_init.c. Referenced by R_Register(). |
|
|
Definition at line 94 of file tr_init.c. Referenced by GLimp_EndFrame(), R_Register(), and RE_BeginFrame(). |
|
|
Definition at line 66 of file tr_init.c. Referenced by R_AddEntitySurfaces(), and R_Register(). |
|
|
Definition at line 58 of file tr_init.c. Referenced by R_Register(), and RB_DrawSun(). |
|
|
Definition at line 67 of file tr_init.c. Referenced by R_AddWorldSurfaces(), and R_Register(). |
|
|
Definition at line 59 of file tr_init.c. Referenced by R_Register(), and RE_RenderScene(). |
|
|
Definition at line 81 of file tr_init.c. Referenced by GLW_InitExtensions(), and R_Register(). |
|
|
Definition at line 78 of file tr_init.c. Referenced by GLW_InitExtensions(), and R_Register(). |
|
|
Definition at line 79 of file tr_init.c. Referenced by GLW_InitExtensions(), and R_Register(). |
|
|
Definition at line 80 of file tr_init.c. Referenced by GLW_InitExtensions(), and R_Register(). |
|
|
Definition at line 82 of file tr_init.c. Referenced by GLW_InitExtensions(), and R_Register(). |
|
|
Definition at line 72 of file tr_init.c. Referenced by R_CullSurface(), and R_Register(). |
|
|
Definition at line 57 of file tr_init.c. Referenced by R_MirrorViewBySurface(), R_Register(), RB_BeginDrawingView(), and RB_StageIteratorSky(). |
|
|
Definition at line 110 of file tr_init.c. Referenced by GfxInfo_f(), R_Register(), and RB_BeginDrawingView(). |
|
|
Definition at line 32 of file tr_init.c. Referenced by R_Register(), and RB_TestFlare(). |
|
|
Definition at line 100 of file tr_init.c. Referenced by R_Register(), RB_AddDlightFlares(), and RB_RenderFlares(). |
|
|
Definition at line 31 of file tr_init.c. Referenced by R_Register(), and RB_RenderFlare(). |
|
|
Definition at line 69 of file tr_init.c. Referenced by R_Register(), and ShaderForShaderNum(). |
|
|
Definition at line 125 of file tr_init.c. Referenced by CreateGameWindow(), GetPixelAttributes(), GfxInfo_f(), GLimp_Init(), GLW_LoadOpenGL(), GLW_StartDriverAndSetMode(), MainWndProc(), R_Register(), Sys_GetMatchingDisplayMode(), Sys_Hide(), and Sys_InitInput(). |
|
|
Definition at line 116 of file tr_init.c. Referenced by R_Register(), R_SetColorMappings(), and RE_BeginFrame(). |
|
|
Definition at line 95 of file tr_init.c. Referenced by GLimp_Init(), GLW_SetMode(), GLW_StartOpenGL(), and R_Register(). |
|
|
Definition at line 41 of file tr_init.c. Referenced by R_Register(), and RB_SurfaceFlare(). |
|
|
Definition at line 38 of file tr_init.c. Referenced by ComputeStageIteratorFunc(), and R_Register(). |
|
|
Definition at line 84 of file tr_init.c. Referenced by GL_CheckErrors(), R_Register(), and RE_BeginFrame(). |
|
|
Definition at line 53 of file tr_init.c. Referenced by GLimp_SetGamma(), GLW_InitExtensions(), R_Register(), and WG_CheckHardwareGamma(). |
|
|
Definition at line 56 of file tr_init.c. Referenced by R_Register(). |
|
|
Definition at line 117 of file tr_init.c. Referenced by R_Register(), and R_SetColorMappings(). |
|
|
Definition at line 96 of file tr_init.c. Referenced by DrawMultitextured(), R_LoadLightmaps(), R_Register(), RB_IterateStagesGeneric(), and RB_StageIteratorLightmappedMultitexture(). |
|
|
Definition at line 118 of file tr_init.c. Referenced by R_MarkLeaves(), and R_Register(). |
|
|
Definition at line 62 of file tr_init.c. Referenced by R_ComputeLOD(), and R_Register(). |
|
|
Definition at line 123 of file tr_init.c. Referenced by LodErrorForVolume(), and R_Register(). |
|
|
Definition at line 63 of file tr_init.c. Referenced by R_ComputeLOD(), and R_Register(). |
|
|
Definition at line 85 of file tr_init.c. Referenced by GLimp_EndFrame(), QGL_EnableLogging(), QGL_Init(), R_Register(), RB_StageIteratorGeneric(), RB_StageIteratorLightmappedMultitexture(), and RB_StageIteratorVertexLitTexture(). |
|
|
Definition at line 132 of file tr_init.c. Referenced by R_ColorShiftLightingBytes(), and R_Register(). |
|
|
Definition at line 146 of file tr_init.c. Referenced by R_Init(), and R_Register(). |
|
|
Definition at line 148 of file tr_init.c. Referenced by R_Init(), and R_Register(). |
|
|
Definition at line 54 of file tr_init.c. Referenced by R_Register(), RB_BeginDrawingView(), RB_SwapBuffers(), and RE_BeginFrame(). |
|
|
Definition at line 101 of file tr_init.c. Referenced by CreateGameWindow(), GfxInfo_f(), GLimp_ChangeMode(), GLW_LoadOpenGL(), GLW_StartDriverAndSetMode(), and R_Register(). |
|
|
Definition at line 102 of file tr_init.c. Referenced by GL_Bind(), GL_BindMultitexture(), and R_Register(). |
|
|
Definition at line 71 of file tr_init.c. Referenced by R_CullLocalBox(), R_CullPointAndRadius(), R_CullSurface(), R_RecursiveWorldNode(), and R_Register(). |
|
|
Definition at line 74 of file tr_init.c. Referenced by R_CullGrid(), and R_Register(). |
|
|
Definition at line 119 of file tr_init.c. Referenced by R_MirrorViewBySurface(), and R_Register(). |
|
|
Definition at line 65 of file tr_init.c. Referenced by R_Register(), and RE_RenderScene(). |
|
|
Definition at line 70 of file tr_init.c. Referenced by R_MarkLeaves(), and R_Register(). |
|
|
Definition at line 114 of file tr_init.c. Referenced by R_Register(), and RB_StageIteratorGeneric(). |
|
|
Definition at line 115 of file tr_init.c. Referenced by R_Register(), and RB_StageIteratorGeneric(). |
|
|
Definition at line 131 of file tr_init.c. Referenced by R_Register(), and R_SetColorMappings(). |
|
|
Definition at line 106 of file tr_init.c. Referenced by GfxInfo_f(), R_Register(), and Upload32(). |
|
|
Definition at line 120 of file tr_init.c. Referenced by R_Register(), and R_SortDrawSurfs(). |
|
|
Definition at line 91 of file tr_init.c. Referenced by GfxInfo_f(), R_DrawElements(), and R_Register(). |
|
|
Definition at line 143 of file tr_init.c. Referenced by R_FindShader(), and R_Register(). |
|
|
Definition at line 35 of file tr_init.c. Referenced by R_Register(), and RB_SurfaceRailCore(). |
|
|
Definition at line 36 of file tr_init.c. Referenced by R_Register(), and RB_SurfaceRailRings(). |
|
|
Definition at line 34 of file tr_init.c. Referenced by DoRailDiscs(), and R_Register(). |
|
|
Definition at line 104 of file tr_init.c. Referenced by R_Register(), and Upload32(). |
|
|
Definition at line 144 of file tr_init.c. Referenced by R_Register(), and RE_RegisterFont(). |
|
|
Definition at line 99 of file tr_init.c. Referenced by R_AddMD3Surfaces(), R_Register(), RB_BeginDrawingView(), RB_ShadowFinish(), and RE_BeginFrame(). |
|
|
Definition at line 73 of file tr_init.c. Referenced by R_MarkLeaves(), and R_Register(). |
|
|
Definition at line 137 of file tr_init.c. Referenced by R_Register(), RB_ShowImages(), and RB_SwapBuffers(). |
|
|
Definition at line 109 of file tr_init.c. Referenced by R_Register(), and RB_EndSurface(). |
|
|
Definition at line 108 of file tr_init.c. Referenced by R_Register(), and RB_StageIteratorSky(). |
|
|
Definition at line 50 of file tr_init.c. Referenced by R_IssueRenderCommands(), and R_Register(). |
|
|
Definition at line 107 of file tr_init.c. Referenced by R_Register(), and RB_EndSurface(). |
|
|
Definition at line 135 of file tr_init.c. Referenced by R_MipMap(), and R_Register(). |
|
|
Definition at line 103 of file tr_init.c. Referenced by ParseFace(), ParseFlare(), ParseMesh(), ParseTriSurf(), and R_Register(). |
|
|
Definition at line 51 of file tr_init.c. Referenced by R_IssueRenderCommands(), and R_Register(). |
|
|
Definition at line 49 of file tr_init.c. Referenced by R_FindShader(), R_Init(), R_InitCommandBuffers(), R_Register(), R_ToggleSmpFrame(), RB_ExecuteRenderCommands(), and RE_RegisterShaderFromImage(). |
|
|
Definition at line 68 of file tr_init.c. Referenced by R_PerformanceCounters(), R_Register(), and RE_StretchRaw(). |
|
|
Definition at line 87 of file tr_init.c. Referenced by GetPixelAttributes(), GLW_InitDriver(), GLW_SetMode(), and R_Register(). |
|
|
Definition at line 90 of file tr_init.c. Referenced by GLW_InitDriver(), and R_Register(). |
|
|
Definition at line 122 of file tr_init.c. Referenced by R_Register(), and R_SubdividePatchToGrid(). |
|
|
Definition at line 112 of file tr_init.c. Referenced by GLimp_EndFrame(), GLW_InitExtensions(), and R_Register(). |
|
|
Definition at line 92 of file tr_init.c. Referenced by GfxInfo_f(), R_Register(), and Upload32(). |
|
|
Definition at line 113 of file tr_init.c. Referenced by GfxInfo_f(), GL_SetDefaultState(), R_Register(), and RE_BeginFrame(). |
|
|
Definition at line 98 of file tr_init.c. Referenced by FinishShader(), R_Register(), and RB_IterateStagesGeneric(). |
|
|
Definition at line 40 of file tr_init.c. Referenced by GetPixelAttributes(), GLW_ChoosePFD(), R_Register(), and Sys_GetMatchingDisplayMode(). |
|
|
Definition at line 97 of file tr_init.c. Referenced by FinishShader(), GfxInfo_f(), R_LoadEntities(), R_LoadLightmaps(), R_Register(), RB_IterateStagesGeneric(), RE_RenderScene(), and ShaderForShaderNum(). |
|
|
Initial value:
{
{ "Mode 0: 320x240", 320, 240, 1 },
{ "Mode 1: 400x300", 400, 300, 1 },
{ "Mode 2: 512x384", 512, 384, 1 },
{ "Mode 3: 640x480", 640, 480, 1 },
{ "Mode 4: 800x600", 800, 600, 1 },
{ "Mode 5: 960x720", 960, 720, 1 },
{ "Mode 6: 1024x768", 1024, 768, 1 },
{ "Mode 7: 1152x864", 1152, 864, 1 },
{ "Mode 8: 1280x1024", 1280, 1024, 1 },
{ "Mode 9: 1600x1200", 1600, 1200, 1 },
{ "Mode 10: 2048x1536", 2048, 1536, 1 },
{ "Mode 11: 856x480 (wide)",856, 480, 1 }
}
Definition at line 290 of file tr_init.c. Referenced by R_GetModeInfo(), and R_ModeList_f(). |
|
|
Definition at line 47 of file tr_init.c. Referenced by R_Register(), and R_SetupProjection(). |
|
|
|
|
|
|
|
|
|
1.3.9.1