22 Mar 2017
This commit is contained in:
parent
4515bcda8d
commit
35922eadcb
|
@ -42,7 +42,7 @@ GNU General Public License for more details.
|
|||
#define PARM_TEX_TEXNUM 9
|
||||
#define PARM_TEX_FLAGS 10
|
||||
#define PARM_TEX_DEPTH 11 // 3D texture depth or 2D array num layers
|
||||
#define PARM_TEX_CACHEFRAME 12 // compare with worldmodel->needload
|
||||
//reserved
|
||||
#define PARM_TEX_GLFORMAT 13 // get a texture GL-format
|
||||
#define PARM_TEX_ENCODE 14 // custom encoding for DXT image
|
||||
#define PARM_TEX_MIPCOUNT 15 // count of mipmaps (0 - autogenerated, 1 - disabled of mipmapping)
|
||||
|
@ -58,7 +58,7 @@ GNU General Public License for more details.
|
|||
#define PARM_CLIENT_INGAME 25
|
||||
#define PARM_FEATURES 26 // same as movevars->features
|
||||
#define PARM_ACTIVE_TMU 27 // for debug
|
||||
#define PARM_CACHEFRAME 28
|
||||
//reserved
|
||||
#define PARM_MAX_IMAGE_UNITS 29
|
||||
#define PARM_CLIENT_ACTIVE 30
|
||||
#define PARM_REBUILD_GAMMA 31 // if true lightmaps rebuilding for gamma change
|
||||
|
@ -84,7 +84,7 @@ typedef enum
|
|||
TF_KEEP_RGBDATA = (1<<1), // some images keep source
|
||||
TF_NOFLIP_TGA = (1<<2), // Steam background completely ignore tga attribute 0x20
|
||||
TF_KEEP_8BIT = (1<<3), // keep original 8-bit image (if present)
|
||||
TF_NOPICMIP = (1<<4), // ignore r_picmip resample rules
|
||||
// reserved
|
||||
TF_UNCOMPRESSED = (1<<5), // don't compress texture in video memory
|
||||
TF_CUBEMAP = (1<<6), // it's cubemap texture
|
||||
TF_DEPTHMAP = (1<<7), // custom texture filter used
|
||||
|
@ -124,9 +124,6 @@ typedef enum
|
|||
GLES_WRAPPER_NANOGL, // used on GLES platforms
|
||||
} gles_wrapper_t;
|
||||
|
||||
typedef struct beam_s BEAM;
|
||||
typedef struct particle_s particle_t;
|
||||
|
||||
// 12 bytes here
|
||||
typedef struct modelstate_s
|
||||
{
|
||||
|
@ -165,12 +162,12 @@ typedef struct render_api_s
|
|||
dlight_t* (*GetDynamicLight)( int number );
|
||||
dlight_t* (*GetEntityLight)( int number );
|
||||
byte (*LightToTexGamma)( byte color ); // software gamma support
|
||||
void (*GetBeamChains)( BEAM ***active_beams, BEAM ***free_beams, particle_t ***free_trails );
|
||||
void (*Reserved0)( void );
|
||||
|
||||
// Set renderer info (tell engine about changes)
|
||||
void (*R_SetCurrentEntity)( struct cl_entity_s *ent ); // tell engine about both currententity and currentmodel
|
||||
void (*R_SetCurrentModel)( struct model_s *mod ); // change currentmodel but leave currententity unchanged
|
||||
void (*GL_SetWorldviewProjectionMatrix)( const float *glmatrix ); // update viewprojection matrix (tracers uses it)
|
||||
void (*Reserved1)( void ); // update viewprojection matrix (tracers uses it)
|
||||
void (*R_StoreEfrags)( struct efrag_s **ppefrag, int framecount );// store efrags for static entities
|
||||
|
||||
// Texture tools
|
||||
|
@ -184,7 +181,7 @@ typedef struct render_api_s
|
|||
void (*GL_FreeTexture)( unsigned int texnum );
|
||||
|
||||
// Decals manipulating (draw & remove)
|
||||
void (*DrawSingleDecal)( struct decal_s *pDecal, struct msurface_s *fa );
|
||||
void (*Reserved2)( void );
|
||||
float *(*R_DecalSetupVerts)( struct decal_s *pDecal, struct msurface_s *surf, int texture, int *outCount );
|
||||
void (*R_EntityRemoveDecals)( struct model_s *mod ); // remove all the decals from specified entity (BSP only)
|
||||
|
||||
|
|
|
@ -1052,7 +1052,7 @@ void CL_LinkPacketEntities( frame_t *frame )
|
|||
|
||||
if( !ent->model )
|
||||
{
|
||||
MsgDev( D_ERROR, "CL_LinkPacketEntity: entity %i without model\n", state->number );
|
||||
// MsgDev( D_ERROR, "CL_LinkPacketEntity: entity %i without model\n", state->number );
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -241,11 +241,11 @@ void V_GetRefParams( ref_params_t *fd, ref_viewpass_t *rvp )
|
|||
rvp->fov_x = bound( 10.0f, cl.local.scr_fov, 150.0f ); // this is a final fov value
|
||||
|
||||
// first we need to compute FOV and other things that needs for frustum properly work
|
||||
rvp->fov_y = V_CalcFov( &rvp->fov_x, rvp->viewport[2], rvp->viewport[3] );
|
||||
rvp->fov_y = V_CalcFov( &rvp->fov_x, clgame.viewport[2], clgame.viewport[3] );
|
||||
|
||||
// adjust FOV for widescreen
|
||||
if( glState.wideScreen && r_adjust_fov->value )
|
||||
V_AdjustFov( &rvp->fov_x, &rvp->fov_y, rvp->viewport[2], rvp->viewport[3], false );
|
||||
V_AdjustFov( &rvp->fov_x, &rvp->fov_y, clgame.viewport[2], clgame.viewport[3], false );
|
||||
|
||||
rvp->flags = 0;
|
||||
|
||||
|
|
|
@ -857,7 +857,7 @@ void CL_DrawParticlesExternal( const ref_viewpass_t *rvp, qboolean solid_pass );
|
|||
void CL_FireCustomDecal( int textureIndex, int entityIndex, int modelIndex, float *pos, int flags, float scale );
|
||||
void CL_DecalShoot( int textureIndex, int entityIndex, int modelIndex, float *pos, int flags );
|
||||
void CL_PlayerDecal( int textureIndex, int entityIndex, float *pos );
|
||||
void R_FreeDeadParticles( particle_t **ppparticles );
|
||||
void R_FreeDeadParticles( struct particle_s **ppparticles );
|
||||
int CL_FxBlend( cl_entity_t *e );
|
||||
void CL_InitParticles( void );
|
||||
void CL_ClearParticles( void );
|
||||
|
|
|
@ -552,12 +552,6 @@ static void GL_SetTextureDimensions( gltexture_t *tex, int width, int height, in
|
|||
width >>= (int)gl_skymip->value;
|
||||
height >>= (int)gl_skymip->value;
|
||||
}
|
||||
else if( !FBitSet( tex->flags, TF_NOPICMIP ))
|
||||
{
|
||||
// let people sample down the world textures for speed
|
||||
width >>= (int)gl_picmip->value;
|
||||
height >>= (int)gl_picmip->value;
|
||||
}
|
||||
|
||||
// set the texture dimensions
|
||||
tex->width = Q_max( 1, width );
|
||||
|
@ -1187,7 +1181,6 @@ static void GL_ProcessImage( gltexture_t *tex, rgbdata_t *pic, imgfilter_t *filt
|
|||
// clear all the unsupported flags
|
||||
tex->flags &= ~TF_KEEP_8BIT;
|
||||
tex->flags &= ~TF_KEEP_RGBDATA;
|
||||
tex->flags |= TF_NOPICMIP;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1251,11 +1244,7 @@ int GL_LoadTexture( const char *name, const byte *buf, size_t size, int flags, i
|
|||
for( tex = r_texturesHashTable[hash]; tex != NULL; tex = tex->nextHash )
|
||||
{
|
||||
if( !Q_stricmp( tex->name, name ))
|
||||
{
|
||||
// prolonge registration
|
||||
tex->cacheframe = world.load_sequence;
|
||||
return (tex - r_textures);
|
||||
}
|
||||
}
|
||||
|
||||
if( flags & TF_NOFLIP_TGA )
|
||||
|
@ -1365,11 +1354,7 @@ int GL_LoadTextureArray( const char **names, int flags, imgfilter_t *filter )
|
|||
for( tex = r_texturesHashTable[hash]; tex != NULL; tex = tex->nextHash )
|
||||
{
|
||||
if( !Q_stricmp( tex->name, name ))
|
||||
{
|
||||
// prolonge registration
|
||||
tex->cacheframe = world.load_sequence;
|
||||
return (tex - r_textures);
|
||||
}
|
||||
}
|
||||
|
||||
// load all the images and pack it into single image
|
||||
|
@ -1519,8 +1504,6 @@ int GL_LoadTextureInternal( const char *name, rgbdata_t *pic, texFlags_t flags,
|
|||
{
|
||||
if( !Q_stricmp( tex->name, name ))
|
||||
{
|
||||
// prolonge registration
|
||||
tex->cacheframe = world.load_sequence;
|
||||
if( update ) break;
|
||||
return (tex - r_textures);
|
||||
}
|
||||
|
@ -1740,11 +1723,7 @@ int GL_FindTexture( const char *name )
|
|||
for( tex = r_texturesHashTable[hash]; tex != NULL; tex = tex->nextHash )
|
||||
{
|
||||
if( !Q_stricmp( tex->name, name ))
|
||||
{
|
||||
// prolonge registration
|
||||
tex->cacheframe = world.load_sequence;
|
||||
return (tex - r_textures);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -1895,7 +1874,7 @@ static rgbdata_t *R_InitSkyTexture( texFlags_t *flags )
|
|||
for( i = 0; i < 256; i++ )
|
||||
((uint *)&data2D)[i] = 0xFFFFDEB5;
|
||||
|
||||
*flags = TF_NOPICMIP|TF_UNCOMPRESSED;
|
||||
*flags = TF_UNCOMPRESSED;
|
||||
|
||||
r_image.buffer = data2D;
|
||||
r_image.width = r_image.height = 16;
|
||||
|
@ -1919,7 +1898,7 @@ static rgbdata_t *R_InitCinematicTexture( texFlags_t *flags )
|
|||
r_image.width = r_image.height = 256;
|
||||
r_image.size = r_image.width * r_image.height * 4;
|
||||
|
||||
*flags = TF_NOMIPMAP|TF_NOPICMIP|TF_UNCOMPRESSED|TF_CLAMP;
|
||||
*flags = TF_NOMIPMAP|TF_UNCOMPRESSED|TF_CLAMP;
|
||||
|
||||
return &r_image;
|
||||
}
|
||||
|
@ -1938,7 +1917,7 @@ static rgbdata_t *R_InitSolidColorTexture( texFlags_t *flags, int color )
|
|||
r_image.type = PF_RGB_24;
|
||||
r_image.size = r_image.width * r_image.height * 3;
|
||||
|
||||
*flags = TF_NOPICMIP|TF_UNCOMPRESSED;
|
||||
*flags = TF_UNCOMPRESSED;
|
||||
|
||||
data2D[0] = data2D[1] = data2D[2] = color;
|
||||
return &r_image;
|
||||
|
@ -2163,7 +2142,7 @@ static rgbdata_t *R_InitDlightTexture( texFlags_t *flags )
|
|||
|
||||
memset( data2D, 0x00, r_image.size );
|
||||
|
||||
*flags = TF_NOPICMIP|TF_UNCOMPRESSED|TF_NOMIPMAP;
|
||||
*flags = TF_UNCOMPRESSED|TF_NOMIPMAP;
|
||||
|
||||
return &r_image;
|
||||
}
|
||||
|
@ -2180,7 +2159,7 @@ static rgbdata_t *R_InitDlightTexture2( texFlags_t *flags )
|
|||
|
||||
memset( data2D, 0x00, r_image.size );
|
||||
|
||||
*flags = TF_NOPICMIP|TF_UNCOMPRESSED|TF_NOMIPMAP;
|
||||
*flags = TF_UNCOMPRESSED|TF_NOMIPMAP;
|
||||
|
||||
return &r_image;
|
||||
}
|
||||
|
@ -2231,7 +2210,7 @@ static rgbdata_t *R_InitNormalizeCubemap( texFlags_t *flags )
|
|||
dataCM += (size*size*4); // move pointer
|
||||
}
|
||||
|
||||
*flags = (TF_NOPICMIP|TF_NOMIPMAP|TF_UNCOMPRESSED|TF_CUBEMAP|TF_CLAMP);
|
||||
*flags = (TF_NOMIPMAP|TF_UNCOMPRESSED|TF_CUBEMAP|TF_CLAMP);
|
||||
|
||||
r_image.width = r_image.height = size;
|
||||
r_image.size = r_image.width * r_image.height * 4 * 6;
|
||||
|
@ -2276,7 +2255,7 @@ static rgbdata_t *R_InitDlightCubemap( texFlags_t *flags )
|
|||
dataCM += (size * size * 4); // move pointer
|
||||
}
|
||||
|
||||
*flags = (TF_NOPICMIP|TF_NOMIPMAP|TF_UNCOMPRESSED|TF_CUBEMAP|TF_CLAMP);
|
||||
*flags = (TF_NOMIPMAP|TF_UNCOMPRESSED|TF_CUBEMAP|TF_CLAMP);
|
||||
|
||||
r_image.width = r_image.height = size;
|
||||
r_image.size = r_image.width * r_image.height * 4 * 6;
|
||||
|
@ -2303,7 +2282,7 @@ static rgbdata_t *R_InitGrayCubemap( texFlags_t *flags )
|
|||
// gray cubemap - just stub for pointlights
|
||||
memset( dataCM, 0x7F, size * size * 6 * 4 );
|
||||
|
||||
*flags = (TF_NOPICMIP|TF_NOMIPMAP|TF_UNCOMPRESSED|TF_CUBEMAP|TF_CLAMP);
|
||||
*flags = (TF_NOMIPMAP|TF_UNCOMPRESSED|TF_CUBEMAP|TF_CLAMP);
|
||||
|
||||
r_image.width = r_image.height = size;
|
||||
r_image.size = r_image.width * r_image.height * 4 * 6;
|
||||
|
@ -2330,7 +2309,7 @@ static rgbdata_t *R_InitWhiteCubemap( texFlags_t *flags )
|
|||
// white cubemap - just stub for pointlights
|
||||
memset( dataCM, 0xFF, size * size * 6 * 4 );
|
||||
|
||||
*flags = (TF_NOPICMIP|TF_NOMIPMAP|TF_UNCOMPRESSED|TF_CUBEMAP|TF_CLAMP);
|
||||
*flags = (TF_NOMIPMAP|TF_UNCOMPRESSED|TF_CUBEMAP|TF_CLAMP);
|
||||
|
||||
r_image.width = r_image.height = size;
|
||||
r_image.size = r_image.width * r_image.height * 4 * 6;
|
||||
|
@ -2364,7 +2343,7 @@ static rgbdata_t *R_InitVSDCTCubemap( texFlags_t *flags )
|
|||
0x00, 0x00, 0x99, 0xFF, // -Z: <0, 0>, <1.5, 2.5>
|
||||
};
|
||||
|
||||
*flags = (TF_NOPICMIP|TF_UNCOMPRESSED|TF_NEAREST|TF_CUBEMAP|TF_CLAMP);
|
||||
*flags = (TF_UNCOMPRESSED|TF_NEAREST|TF_CUBEMAP|TF_CLAMP);
|
||||
|
||||
r_image.width = r_image.height = 1;
|
||||
r_image.size = r_image.width * r_image.height * 4 * 6;
|
||||
|
|
|
@ -52,9 +52,9 @@ extern byte *r_temppool;
|
|||
#define RP_LOCALCLIENT( e ) ((e) != NULL && (e)->index == ( cl.playernum + 1 ) && e->player )
|
||||
#define RP_NORMALPASS() ((RI.params & RP_NONVIEWERREF) == 0 )
|
||||
|
||||
#define TF_SKY (TF_SKYSIDE|TF_UNCOMPRESSED|TF_NOMIPMAP|TF_NOPICMIP)
|
||||
#define TF_FONT (TF_UNCOMPRESSED|TF_NOPICMIP|TF_NOMIPMAP|TF_CLAMP)
|
||||
#define TF_IMAGE (TF_UNCOMPRESSED|TF_NOPICMIP|TF_NOMIPMAP|TF_CLAMP)
|
||||
#define TF_SKY (TF_SKYSIDE|TF_UNCOMPRESSED|TF_NOMIPMAP)
|
||||
#define TF_FONT (TF_UNCOMPRESSED|TF_NOMIPMAP|TF_CLAMP)
|
||||
#define TF_IMAGE (TF_UNCOMPRESSED|TF_NOMIPMAP|TF_CLAMP)
|
||||
#define TF_DECAL (TF_CLAMP|TF_UNCOMPRESSED)
|
||||
|
||||
typedef struct gltexture_s
|
||||
|
@ -67,8 +67,6 @@ typedef struct gltexture_s
|
|||
word depth; // texture depth or count of layers for 2D_ARRAY
|
||||
byte numMips; // mipmap count
|
||||
|
||||
uint cacheframe; // worldmodel->load_sequence
|
||||
|
||||
GLuint target; // glTarget
|
||||
GLuint texnum; // gl texture binding
|
||||
GLint format; // uploaded format
|
||||
|
@ -644,7 +642,6 @@ extern convar_t *gl_detailscale;
|
|||
extern convar_t *gl_wireframe;
|
||||
extern convar_t *gl_allow_static;
|
||||
extern convar_t *gl_allow_mirrors;
|
||||
extern convar_t *gl_picmip;
|
||||
extern convar_t *gl_skymip;
|
||||
extern convar_t *gl_finish;
|
||||
extern convar_t *gl_nosort;
|
||||
|
|
|
@ -1209,13 +1209,8 @@ static int GL_RenderGetParm( int parm, int arg )
|
|||
return host.features;
|
||||
case PARM_ACTIVE_TMU:
|
||||
return glState.activeTMU;
|
||||
case PARM_TEX_CACHEFRAME:
|
||||
glt = R_GetTexture( arg );
|
||||
return glt->cacheframe;
|
||||
case PARM_MAP_HAS_DELUXE:
|
||||
return (world.deluxedata != NULL);
|
||||
case PARM_CACHEFRAME:
|
||||
return world.load_sequence;
|
||||
case PARM_MAX_IMAGE_UNITS:
|
||||
return GL_MaxTextureUnits();
|
||||
case PARM_CLIENT_ACTIVE:
|
||||
|
@ -1254,13 +1249,6 @@ static void R_GetExtraParmsForTexture( int texture, byte *red, byte *green, byte
|
|||
if( density ) *density = glt->fogParams[3];
|
||||
}
|
||||
|
||||
static void GL_TextureUpdateCache( unsigned int texture )
|
||||
{
|
||||
gltexture_t *glt = R_GetTexture( texture );
|
||||
if( !glt || !glt->texnum ) return;
|
||||
glt->cacheframe = world.load_sequence;
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
R_EnvShot
|
||||
|
@ -1337,20 +1325,6 @@ static dlight_t *CL_GetEntityLight( int number )
|
|||
return &cl_elights[number];
|
||||
}
|
||||
|
||||
static void CL_GetBeamChains( BEAM ***active_beams, BEAM ***free_beams, particle_t ***free_trails )
|
||||
{
|
||||
*active_beams = &cl_active_beams;
|
||||
*free_beams = &cl_free_beams;
|
||||
*free_trails = &cl_free_particles;
|
||||
}
|
||||
|
||||
static void GL_SetWorldviewProjectionMatrix( const float *glmatrix )
|
||||
{
|
||||
if( !glmatrix ) return;
|
||||
|
||||
Matrix4x4_FromArrayFloatGL( RI.worldviewProjectionMatrix, glmatrix );
|
||||
}
|
||||
|
||||
static const char *GL_TextureName( unsigned int texnum )
|
||||
{
|
||||
return R_GetTexture( texnum )->name;
|
||||
|
@ -1424,10 +1398,10 @@ static render_api_t gRenderAPI =
|
|||
CL_GetDynamicLight,
|
||||
CL_GetEntityLight,
|
||||
LightToTexGamma,
|
||||
CL_GetBeamChains,
|
||||
NULL,
|
||||
R_SetCurrentEntity,
|
||||
R_SetCurrentModel,
|
||||
GL_SetWorldviewProjectionMatrix,
|
||||
NULL,
|
||||
R_StoreEfrags,
|
||||
GL_FindTexture,
|
||||
GL_TextureName,
|
||||
|
@ -1437,7 +1411,7 @@ static render_api_t gRenderAPI =
|
|||
GL_LoadTextureArrayNoFilter,
|
||||
GL_CreateTextureArray,
|
||||
GL_FreeTexture,
|
||||
DrawSingleDecal,
|
||||
NULL,
|
||||
R_DecalSetupVerts,
|
||||
R_EntityRemoveDecals,
|
||||
AVI_LoadVideoNoSound,
|
||||
|
|
|
@ -43,7 +43,6 @@ convar_t *gl_allow_mirrors;
|
|||
convar_t *gl_wireframe;
|
||||
convar_t *gl_round_down;
|
||||
convar_t *gl_max_size;
|
||||
convar_t *gl_picmip;
|
||||
convar_t *gl_skymip;
|
||||
convar_t *gl_finish;
|
||||
convar_t *gl_nosort;
|
||||
|
@ -51,8 +50,8 @@ convar_t *gl_vsync;
|
|||
convar_t *gl_clear;
|
||||
convar_t *gl_test;
|
||||
|
||||
convar_t *r_xpos;
|
||||
convar_t *r_ypos;
|
||||
convar_t *window_xpos;
|
||||
convar_t *window_ypos;
|
||||
convar_t *r_speeds;
|
||||
convar_t *r_fullbright;
|
||||
convar_t *r_norefresh;
|
||||
|
@ -883,7 +882,7 @@ VID_StartupGamma
|
|||
void VID_StartupGamma( void )
|
||||
{
|
||||
BuildGammaTable( vid_gamma->value, vid_brightness->value );
|
||||
MsgDev( D_NOTE, "VID_StartupGamma: gamma initialized\n" );
|
||||
MsgDev( D_NOTE, "VID_StartupGamma: gamma %g brightness %g\n", vid_gamma->value, vid_brightness->value );
|
||||
ClearBits( vid_brightness->flags, FCVAR_CHANGED );
|
||||
ClearBits( vid_gamma->flags, FCVAR_CHANGED );
|
||||
}
|
||||
|
@ -1098,8 +1097,8 @@ qboolean VID_CreateWindow( int width, int height, qboolean fullscreen )
|
|||
|
||||
if( !fullscreen )
|
||||
{
|
||||
x = r_xpos->value;
|
||||
y = r_ypos->value;
|
||||
x = window_xpos->value;
|
||||
y = window_ypos->value;
|
||||
|
||||
// adjust window coordinates if necessary
|
||||
// so that the window is completely on screen
|
||||
|
@ -1544,7 +1543,6 @@ void R_RenderInfo_f( void )
|
|||
Msg( "\n" );
|
||||
Msg( "%s [%i x %i]\n", vidmode[(int)vid_mode->value].desc, glState.width, glState.height );
|
||||
Msg( "\n" );
|
||||
Msg( "PICMIP: %i\n", gl_picmip->value );
|
||||
Msg( "SKYMIP: %i\n", gl_skymip->value );
|
||||
Msg( "VERTICAL SYNC: %s\n", gl_vsync->value ? "enabled" : "disabled" );
|
||||
Msg( "Color %d bits, Alpha %d bits, Depth %d bits, Stencil %d bits\n", glConfig.color_bits,
|
||||
|
@ -1580,10 +1578,9 @@ void GL_InitCommands( void )
|
|||
r_fastsky = Cvar_Get( "r_fastsky", "0", FCVAR_ARCHIVE, "enable algorhytm fo fast sky rendering (for old machines)" );
|
||||
r_drawentities = Cvar_Get( "r_drawentities", "1", FCVAR_CHEAT|FCVAR_ARCHIVE, "render entities" );
|
||||
r_decals = Cvar_Get( "r_decals", "4096", FCVAR_ARCHIVE, "sets the maximum number of decals" );
|
||||
r_xpos = Cvar_Get( "r_xpos", "130", FCVAR_RENDERINFO, "window position by horizontal" );
|
||||
r_ypos = Cvar_Get( "r_ypos", "48", FCVAR_RENDERINFO, "window position by vertical" );
|
||||
window_xpos = Cvar_Get( "_window_xpos", "130", FCVAR_RENDERINFO, "window position by horizontal" );
|
||||
window_ypos = Cvar_Get( "_window_ypos", "48", FCVAR_RENDERINFO, "window position by vertical" );
|
||||
|
||||
gl_picmip = Cvar_Get( "gl_picmip", "0", FCVAR_GLCONFIG, "reduces resolution of textures by powers of 2" );
|
||||
gl_skymip = Cvar_Get( "gl_skymip", "0", FCVAR_GLCONFIG, "reduces resolution of skybox textures by powers of 2" );
|
||||
gl_alphabits = Cvar_Get( "gl_alphabits", "8", FCVAR_GLCONFIG, "pixelformat alpha bits (0 - auto)" );
|
||||
gl_texture_nearest = Cvar_Get( "gl_texture_nearest", "0", FCVAR_ARCHIVE, "disable texture filter" );
|
||||
|
@ -1613,11 +1610,11 @@ void GL_InitCommands( void )
|
|||
// make sure gl_vsync is checked after vid_restart
|
||||
SetBits( gl_vsync->flags, FCVAR_CHANGED );
|
||||
|
||||
vid_gamma = Cvar_Get( "gamma", "1.0", FCVAR_ARCHIVE, "gamma amount" );
|
||||
vid_brightness = Cvar_Get( "brightness", "1.0", FCVAR_ARCHIVE, "brighntess factor" );
|
||||
vid_mode = Cvar_Get( "vid_mode", VID_AUTOMODE, FCVAR_RENDERINFO, "display resolution mode" );
|
||||
vid_fullscreen = Cvar_Get( "fullscreen", "0", FCVAR_RENDERINFO, "set in 1 to enable fullscreen mode" );
|
||||
vid_displayfrequency = Cvar_Get ( "vid_displayfrequency", "0", FCVAR_RENDERINFO, "fullscreen refresh rate" );
|
||||
vid_gamma = Cvar_Get( "gamma", "1.0", FCVAR_RENDERINFO, "gamma amount" );
|
||||
vid_brightness = Cvar_Get( "brightness", "1.0", FCVAR_RENDERINFO, "brighntess factor" );
|
||||
vid_mode = Cvar_Get( "vid_mode", VID_AUTOMODE, FCVAR_RENDERINFO|FCVAR_VIDRESTART, "display resolution mode" );
|
||||
vid_fullscreen = Cvar_Get( "fullscreen", "0", FCVAR_RENDERINFO|FCVAR_VIDRESTART, "set in 1 to enable fullscreen mode" );
|
||||
vid_displayfrequency = Cvar_Get ( "vid_displayfrequency", "0", FCVAR_RENDERINFO|FCVAR_VIDRESTART, "fullscreen refresh rate" );
|
||||
|
||||
Cmd_AddCommand( "r_info", R_RenderInfo_f, "display renderer info" );
|
||||
|
||||
|
|
|
@ -188,7 +188,7 @@ static void Cvar_Changed( convar_t *var )
|
|||
if( FBitSet( var->flags, FCVAR_MOVEVARS ))
|
||||
host.movevars_changed = true;
|
||||
|
||||
if( FBitSet( var->flags, FCVAR_RENDERINFO ))
|
||||
if( FBitSet( var->flags, FCVAR_VIDRESTART ))
|
||||
host.renderinfo_changed = true;
|
||||
|
||||
if( !Q_strcmp( var->name, "sv_cheats" ))
|
||||
|
|
|
@ -42,6 +42,7 @@ typedef struct convar_s
|
|||
#define FCVAR_READ_ONLY (1<<17) // cannot be set by user at all, and can't be requested by CvarGetPointer from game dlls
|
||||
#define FCVAR_EXTENDED (1<<18) // this is convar_t (sets on registration)
|
||||
#define FCVAR_ALLOCATED (1<<19) // this convar_t is fully dynamic allocated (include description)
|
||||
#define FCVAR_VIDRESTART (1<<20) // recreate the window is cvar with this flag was changed
|
||||
|
||||
#define CVAR_DEFINE( cv, cvname, cvstr, cvflags, cvdesc ) convar_t cv = { cvname, cvstr, cvflags, 0.0f, (void *)CVAR_SENTINEL, cvdesc }
|
||||
#define CVAR_DEFINE_AUTO( cv, cvstr, cvflags, cvdesc ) convar_t cv = { #cv, cvstr, cvflags, 0.0f, (void *)CVAR_SENTINEL, cvdesc }
|
||||
|
|
|
@ -489,8 +489,8 @@ LONG IN_WndProc( HWND hWnd, UINT uMsg, UINT wParam, LONG lParam )
|
|||
style = GetWindowLong( hWnd, GWL_STYLE );
|
||||
AdjustWindowRect( &rect, style, FALSE );
|
||||
|
||||
Cvar_SetValue( "r_xpos", xPos + rect.left );
|
||||
Cvar_SetValue( "r_ypos", yPos + rect.top );
|
||||
Cvar_SetValue( "_window_xpos", xPos + rect.left );
|
||||
Cvar_SetValue( "_window_ypos", yPos + rect.top );
|
||||
GetWindowRect( host.hWnd, &real_rect );
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -1065,6 +1065,7 @@ qboolean Netchan_CopyFileFragments( netchan_t *chan, sizebuf_t *msg )
|
|||
qboolean Netchan_Validate( netchan_t *chan, sizebuf_t *sb, qboolean *frag_message, uint *fragid, int *frag_offset, int *frag_length )
|
||||
{
|
||||
int i, j, frag_end;
|
||||
int chunksize;
|
||||
|
||||
for( i = 0; i < MAX_STREAMS; i++ )
|
||||
{
|
||||
|
@ -1084,7 +1085,12 @@ qboolean Netchan_Validate( netchan_t *chan, sizebuf_t *sb, qboolean *frag_messag
|
|||
if( !frag_length[i] )
|
||||
return false;
|
||||
|
||||
if( BitByte( frag_length[i] ) > FRAGMENT_MAX_SIZE || BitByte( frag_offset[i] ) > ( NET_MAX_PAYLOAD - 1 ))
|
||||
chunksize = FRAGMENT_MAX_SIZE;
|
||||
|
||||
if( i == FRAG_NORMAL_STREAM && Netchan_IsLocal( chan ))
|
||||
chunksize = NET_MAX_PAYLOAD;
|
||||
|
||||
if( BitByte( frag_length[i] ) > chunksize || BitByte( frag_offset[i] ) > ( NET_MAX_PAYLOAD - 1 ))
|
||||
return false;
|
||||
|
||||
frag_end = frag_offset[i] + frag_length[i];
|
||||
|
@ -1233,8 +1239,12 @@ void Netchan_TransmitBits( netchan_t *chan, int length, byte *data )
|
|||
// will be true if we are active and should let chan->message get some bandwidth
|
||||
int send_from_frag[MAX_STREAMS] = { 0, 0 };
|
||||
int send_from_regular = false;
|
||||
int frag_size = MAX_MSGLEN;
|
||||
|
||||
if( MSG_GetNumBytesWritten( &chan->message ) > MAX_MSGLEN && !Netchan_IsLocal( chan ))
|
||||
if( Netchan_IsLocal( chan ))
|
||||
frag_size = (NET_MAX_PAYLOAD / 2);
|
||||
|
||||
if( MSG_GetNumBytesWritten( &chan->message ) > frag_size )
|
||||
{
|
||||
Netchan_CreateFragments_( chan, &chan->message );
|
||||
MSG_Clear( &chan->message );
|
||||
|
|
|
@ -143,7 +143,7 @@ typedef struct fragbuf_s
|
|||
struct fragbuf_s *next; // next buffer in chain
|
||||
int bufferid; // id of this buffer
|
||||
sizebuf_t frag_message; // message buffer where raw data is stored
|
||||
byte frag_message_buf[FRAGMENT_MAX_SIZE]; // the actual data sits here
|
||||
byte frag_message_buf[NET_MAX_PAYLOAD]; // the actual data sits here
|
||||
qboolean isfile; // is this a file buffer?
|
||||
qboolean isbuffer; // is this file buffer from memory ( custom decal, etc. ).
|
||||
char filename[MAX_OSPATH]; // name of the file to save out on remote host
|
||||
|
|
|
@ -153,7 +153,7 @@ typedef struct physics_interface_s
|
|||
// alloc or destroy model custom data (called only for dedicated servers, otherwise using an client version)
|
||||
void (*Mod_ProcessUserData)( struct model_s *mod, qboolean create, const byte *buffer );
|
||||
// select BSP-hull for trace with specified mins\maxs
|
||||
void *(*SV_HullForBsp)( edict_t *ent, const vec3_t mins, const vec3_t maxs, vec3_t offset );
|
||||
void *(*SV_HullForBsp)( edict_t *ent, const float *mins, const float *maxs, float *offset );
|
||||
} physics_interface_t;
|
||||
|
||||
#endif//PHYSINT_H
|
|
@ -1137,7 +1137,7 @@ void SV_PutClientInServer( sv_client_t *cl )
|
|||
int i, viewEnt;
|
||||
|
||||
// NOTE: it's will be fragmented automatically in right ordering
|
||||
// MSG_WriteBits( &cl->netchan.message, MSG_GetData( &sv.signon ), MSG_GetNumBitsWritten( &sv.signon ));
|
||||
MSG_WriteBits( &cl->netchan.message, MSG_GetData( &sv.signon ), MSG_GetNumBitsWritten( &sv.signon ));
|
||||
|
||||
if( cl->pViewEntity )
|
||||
viewEnt = NUM_FOR_EDICT( cl->pViewEntity );
|
||||
|
@ -1147,8 +1147,8 @@ void SV_PutClientInServer( sv_client_t *cl )
|
|||
MSG_WriteWord( &cl->netchan.message, viewEnt );
|
||||
|
||||
// time to send signon buffer
|
||||
Netchan_CreateFragments( &cl->netchan, &sv.signon );
|
||||
Netchan_FragSend( &cl->netchan );
|
||||
// Netchan_CreateFragments( &cl->netchan, &sv.signon );
|
||||
// Netchan_FragSend( &cl->netchan );
|
||||
|
||||
// collect the info about all the players and send to me
|
||||
for( i = 0, cur = svs.clients; i < svs.maxclients; i++, cur++ )
|
||||
|
|
|
@ -243,7 +243,7 @@ hull_t *SV_HullForBsp( edict_t *ent, const vec3_t mins, const vec3_t maxs, vec3_
|
|||
|
||||
if( world.sky_sphere || world.version == Q1BSP_VERSION )
|
||||
{
|
||||
// Using quake-style hull select for my Quake remake
|
||||
// alternate hull select for quake maps
|
||||
if( size[0] < 3.0f || ( model->flags & MODEL_LIQUID && ent->v.solid != SOLID_TRIGGER ))
|
||||
hull = &model->hulls[0];
|
||||
else if( size[0] <= 32.0f )
|
||||
|
|
Reference in New Issue