mirror of
https://github.com/DrBeef/JKXR.git
synced 2024-11-22 04:01:33 +00:00
Drfaulting a lot of cvars
and saber blur now working
This commit is contained in:
parent
83d6fabb98
commit
daafcc6ba4
6 changed files with 22 additions and 16 deletions
|
@ -168,8 +168,8 @@ window_t WIN_Init( const windowDesc_t *windowDesc, glconfig_t *glConfig )
|
||||||
|
|
||||||
// Window render surface cvars
|
// Window render surface cvars
|
||||||
r_stencilbits = Cvar_Get( "r_stencilbits", "8", CVAR_ARCHIVE_ND|CVAR_LATCH );
|
r_stencilbits = Cvar_Get( "r_stencilbits", "8", CVAR_ARCHIVE_ND|CVAR_LATCH );
|
||||||
r_depthbits = Cvar_Get( "r_depthbits", "0", CVAR_ARCHIVE_ND|CVAR_LATCH );
|
r_depthbits = Cvar_Get( "r_depthbits", "24", CVAR_ARCHIVE_ND|CVAR_LATCH );
|
||||||
r_colorbits = Cvar_Get( "r_colorbits", "0", CVAR_ARCHIVE_ND|CVAR_LATCH );
|
r_colorbits = Cvar_Get( "r_colorbits", "32", CVAR_ARCHIVE_ND|CVAR_LATCH );
|
||||||
r_ignorehwgamma = Cvar_Get( "r_ignorehwgamma", "0", CVAR_ARCHIVE_ND|CVAR_LATCH );
|
r_ignorehwgamma = Cvar_Get( "r_ignorehwgamma", "0", CVAR_ARCHIVE_ND|CVAR_LATCH );
|
||||||
r_ext_multisample = Cvar_Get( "r_ext_multisample", "0", CVAR_ARCHIVE_ND|CVAR_LATCH );
|
r_ext_multisample = Cvar_Get( "r_ext_multisample", "0", CVAR_ARCHIVE_ND|CVAR_LATCH );
|
||||||
Cvar_Get( "r_availableModes", "", CVAR_ROM );
|
Cvar_Get( "r_availableModes", "", CVAR_ROM );
|
||||||
|
|
|
@ -37,6 +37,9 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
#define LOOK_SWING_SCALE 0.5f
|
#define LOOK_SWING_SCALE 0.5f
|
||||||
#define CG_SWINGSPEED 0.3f
|
#define CG_SWINGSPEED 0.3f
|
||||||
|
|
||||||
|
//How fast the saber needs to be physically swung in order to trigger sounds and trails
|
||||||
|
#define SABER_ACTIVATE_VELOCITY 0.6f
|
||||||
|
|
||||||
#include "animtable.h"
|
#include "animtable.h"
|
||||||
|
|
||||||
extern qboolean WP_SaberBladeUseSecondBladeStyle( saberInfo_t *saber, int bladeNum );
|
extern qboolean WP_SaberBladeUseSecondBladeStyle( saberInfo_t *saber, int bladeNum );
|
||||||
|
@ -6578,6 +6581,8 @@ Ghoul2 Insert End
|
||||||
|
|
||||||
#define SABER_TRAIL_TIME 40.0f
|
#define SABER_TRAIL_TIME 40.0f
|
||||||
|
|
||||||
|
bool saberInAction = (saberTrail->inAction || (vr->primaryswingvelocity > SABER_ACTIVATE_VELOCITY));
|
||||||
|
|
||||||
// if we happen to be timescaled or running in a high framerate situation, we don't want to flood
|
// if we happen to be timescaled or running in a high framerate situation, we don't want to flood
|
||||||
// the system with very small trail slices...but perhaps doing it by distance would yield better results?
|
// the system with very small trail slices...but perhaps doing it by distance would yield better results?
|
||||||
if ( saberTrail->lastTime > cg.time )
|
if ( saberTrail->lastTime > cg.time )
|
||||||
|
@ -6587,9 +6592,9 @@ Ghoul2 Insert End
|
||||||
//cap it to cg.time here
|
//cap it to cg.time here
|
||||||
saberTrail->lastTime = cg.time;
|
saberTrail->lastTime = cg.time;
|
||||||
}
|
}
|
||||||
if ( cg.time > saberTrail->lastTime + 2 && saberTrail->inAction ) // 2ms
|
if ( cg.time > saberTrail->lastTime + 2 && saberInAction ) // 2ms
|
||||||
{
|
{
|
||||||
if ( saberTrail->inAction && cg.time < saberTrail->lastTime + 300 ) // if we have a stale segment, don't draw until we have a fresh one
|
if ( saberInAction && cg.time < saberTrail->lastTime + 300 ) // if we have a stale segment, don't draw until we have a fresh one
|
||||||
{
|
{
|
||||||
vec3_t rgb1={255,255,255};
|
vec3_t rgb1={255,255,255};
|
||||||
|
|
||||||
|
|
|
@ -1571,7 +1571,7 @@ void R_Register( void )
|
||||||
r_ext_compressed_textures = ri.Cvar_Get( "r_ext_compress_textures", "0", CVAR_ARCHIVE_ND | CVAR_LATCH );
|
r_ext_compressed_textures = ri.Cvar_Get( "r_ext_compress_textures", "0", CVAR_ARCHIVE_ND | CVAR_LATCH );
|
||||||
r_ext_compressed_lightmaps = ri.Cvar_Get( "r_ext_compress_lightmaps", "0", CVAR_ARCHIVE_ND | CVAR_LATCH );
|
r_ext_compressed_lightmaps = ri.Cvar_Get( "r_ext_compress_lightmaps", "0", CVAR_ARCHIVE_ND | CVAR_LATCH );
|
||||||
r_ext_preferred_tc_method = ri.Cvar_Get( "r_ext_preferred_tc_method", "0", CVAR_ARCHIVE_ND | CVAR_LATCH );
|
r_ext_preferred_tc_method = ri.Cvar_Get( "r_ext_preferred_tc_method", "0", CVAR_ARCHIVE_ND | CVAR_LATCH );
|
||||||
r_ext_gamma_control = ri.Cvar_Get( "r_ext_gamma_control", "1", CVAR_ARCHIVE_ND | CVAR_LATCH );
|
r_ext_gamma_control = ri.Cvar_Get( "r_ext_gamma_control", "0", CVAR_ARCHIVE_ND | CVAR_LATCH );
|
||||||
r_ext_multitexture = ri.Cvar_Get( "r_ext_multitexture", "1", CVAR_ARCHIVE_ND | CVAR_LATCH );
|
r_ext_multitexture = ri.Cvar_Get( "r_ext_multitexture", "1", CVAR_ARCHIVE_ND | CVAR_LATCH );
|
||||||
r_ext_compiled_vertex_array = ri.Cvar_Get( "r_ext_compiled_vertex_array", "1", CVAR_ARCHIVE_ND | CVAR_LATCH);
|
r_ext_compiled_vertex_array = ri.Cvar_Get( "r_ext_compiled_vertex_array", "1", CVAR_ARCHIVE_ND | CVAR_LATCH);
|
||||||
r_ext_texture_env_add = ri.Cvar_Get( "r_ext_texture_env_add", "1", CVAR_ARCHIVE_ND | CVAR_LATCH);
|
r_ext_texture_env_add = ri.Cvar_Get( "r_ext_texture_env_add", "1", CVAR_ARCHIVE_ND | CVAR_LATCH);
|
||||||
|
@ -1591,7 +1591,7 @@ void R_Register( void )
|
||||||
r_detailTextures = ri.Cvar_Get( "r_detailtextures", "1", CVAR_ARCHIVE_ND | CVAR_LATCH );
|
r_detailTextures = ri.Cvar_Get( "r_detailtextures", "1", CVAR_ARCHIVE_ND | CVAR_LATCH );
|
||||||
r_texturebits = ri.Cvar_Get( "r_texturebits", "0", CVAR_ARCHIVE_ND | CVAR_LATCH );
|
r_texturebits = ri.Cvar_Get( "r_texturebits", "0", CVAR_ARCHIVE_ND | CVAR_LATCH );
|
||||||
r_texturebitslm = ri.Cvar_Get( "r_texturebitslm", "0", CVAR_ARCHIVE_ND | CVAR_LATCH );
|
r_texturebitslm = ri.Cvar_Get( "r_texturebitslm", "0", CVAR_ARCHIVE_ND | CVAR_LATCH );
|
||||||
r_overBrightBits = ri.Cvar_Get ("r_overBrightBits", "0", CVAR_ARCHIVE_ND | CVAR_LATCH );
|
r_overBrightBits = ri.Cvar_Get ("r_overBrightBits", "1", CVAR_ARCHIVE_ND | CVAR_LATCH );
|
||||||
r_mapOverBrightBits = ri.Cvar_Get( "r_mapOverBrightBits", "0", CVAR_ARCHIVE_ND|CVAR_LATCH );
|
r_mapOverBrightBits = ri.Cvar_Get( "r_mapOverBrightBits", "0", CVAR_ARCHIVE_ND|CVAR_LATCH );
|
||||||
r_simpleMipMaps = ri.Cvar_Get( "r_simpleMipMaps", "1", CVAR_ARCHIVE_ND | CVAR_LATCH );
|
r_simpleMipMaps = ri.Cvar_Get( "r_simpleMipMaps", "1", CVAR_ARCHIVE_ND | CVAR_LATCH );
|
||||||
r_vertexLight = ri.Cvar_Get( "r_vertexLight", "0", CVAR_ARCHIVE | CVAR_LATCH );
|
r_vertexLight = ri.Cvar_Get( "r_vertexLight", "0", CVAR_ARCHIVE | CVAR_LATCH );
|
||||||
|
@ -1608,7 +1608,7 @@ void R_Register( void )
|
||||||
//
|
//
|
||||||
// archived variables that can change at any time
|
// archived variables that can change at any time
|
||||||
//
|
//
|
||||||
r_lodCurveError = ri.Cvar_Get( "r_lodCurveError", "250", CVAR_ARCHIVE_ND );
|
r_lodCurveError = ri.Cvar_Get( "r_lodCurveError", "1000", CVAR_ARCHIVE_ND );
|
||||||
r_lodbias = ri.Cvar_Get( "r_lodbias", "0", CVAR_ARCHIVE_ND );
|
r_lodbias = ri.Cvar_Get( "r_lodbias", "0", CVAR_ARCHIVE_ND );
|
||||||
r_flares = ri.Cvar_Get ("r_flares", "1", CVAR_ARCHIVE_ND );
|
r_flares = ri.Cvar_Get ("r_flares", "1", CVAR_ARCHIVE_ND );
|
||||||
r_lodscale = ri.Cvar_Get( "r_lodscale", "10", CVAR_ARCHIVE_ND );
|
r_lodscale = ri.Cvar_Get( "r_lodscale", "10", CVAR_ARCHIVE_ND );
|
||||||
|
@ -1623,7 +1623,7 @@ void R_Register( void )
|
||||||
// r_dlightBacks = ri.Cvar_Get( "r_dlightBacks", "0", CVAR_ARCHIVE );
|
// r_dlightBacks = ri.Cvar_Get( "r_dlightBacks", "0", CVAR_ARCHIVE );
|
||||||
r_finish = ri.Cvar_Get ("r_finish", "0", CVAR_ARCHIVE_ND);
|
r_finish = ri.Cvar_Get ("r_finish", "0", CVAR_ARCHIVE_ND);
|
||||||
r_textureMode = ri.Cvar_Get( "r_textureMode", "GL_LINEAR_MIPMAP_LINEAR", CVAR_ARCHIVE );
|
r_textureMode = ri.Cvar_Get( "r_textureMode", "GL_LINEAR_MIPMAP_LINEAR", CVAR_ARCHIVE );
|
||||||
r_gamma = ri.Cvar_Get( "r_gamma", "1", CVAR_ARCHIVE_ND );
|
r_gamma = ri.Cvar_Get( "r_gamma", "1.027344", CVAR_ARCHIVE_ND );
|
||||||
r_facePlaneCull = ri.Cvar_Get ("r_facePlaneCull", "1", CVAR_ARCHIVE_ND );
|
r_facePlaneCull = ri.Cvar_Get ("r_facePlaneCull", "1", CVAR_ARCHIVE_ND );
|
||||||
|
|
||||||
r_dlightStyle = ri.Cvar_Get ("r_dlightStyle", "1", CVAR_ARCHIVE_ND);
|
r_dlightStyle = ri.Cvar_Get ("r_dlightStyle", "1", CVAR_ARCHIVE_ND);
|
||||||
|
|
|
@ -4278,14 +4278,14 @@ void UI_GetVideoSetup ( void )
|
||||||
// Make sure the cvars are registered as read only.
|
// Make sure the cvars are registered as read only.
|
||||||
Cvar_Register ( NULL, "ui_r_mode", "0", CVAR_ROM );
|
Cvar_Register ( NULL, "ui_r_mode", "0", CVAR_ROM );
|
||||||
Cvar_Register ( NULL, "ui_r_fullscreen", "0", CVAR_ROM );
|
Cvar_Register ( NULL, "ui_r_fullscreen", "0", CVAR_ROM );
|
||||||
Cvar_Register ( NULL, "ui_r_colorbits", "0", CVAR_ROM );
|
Cvar_Register ( NULL, "ui_r_colorbits", "32", CVAR_ROM );
|
||||||
Cvar_Register ( NULL, "ui_r_lodbias", "0", CVAR_ROM );
|
Cvar_Register ( NULL, "ui_r_lodbias", "0", CVAR_ROM );
|
||||||
Cvar_Register ( NULL, "ui_r_picmip", "0", CVAR_ROM );
|
Cvar_Register ( NULL, "ui_r_picmip", "0", CVAR_ROM );
|
||||||
Cvar_Register ( NULL, "ui_r_texturebits", "0", CVAR_ROM );
|
Cvar_Register ( NULL, "ui_r_texturebits", "0", CVAR_ROM );
|
||||||
Cvar_Register ( NULL, "ui_r_texturemode", "0", CVAR_ROM );
|
Cvar_Register ( NULL, "ui_r_texturemode", "0", CVAR_ROM );
|
||||||
Cvar_Register ( NULL, "ui_r_detailtextures", "0", CVAR_ROM );
|
Cvar_Register ( NULL, "ui_r_detailtextures", "0", CVAR_ROM );
|
||||||
Cvar_Register ( NULL, "ui_r_ext_compress_textures", "0", CVAR_ROM );
|
Cvar_Register ( NULL, "ui_r_ext_compress_textures", "0", CVAR_ROM );
|
||||||
Cvar_Register ( NULL, "ui_r_depthbits", "0", CVAR_ROM );
|
Cvar_Register ( NULL, "ui_r_depthbits", "24", CVAR_ROM );
|
||||||
Cvar_Register ( NULL, "ui_r_subdivisions", "0", CVAR_ROM );
|
Cvar_Register ( NULL, "ui_r_subdivisions", "0", CVAR_ROM );
|
||||||
Cvar_Register ( NULL, "ui_r_fastSky", "0", CVAR_ROM );
|
Cvar_Register ( NULL, "ui_r_fastSky", "0", CVAR_ROM );
|
||||||
Cvar_Register ( NULL, "ui_r_inGameVideo", "0", CVAR_ROM );
|
Cvar_Register ( NULL, "ui_r_inGameVideo", "0", CVAR_ROM );
|
||||||
|
|
|
@ -36,7 +36,7 @@ along with this program; if not, see <http://www.gnu.org/licenses/>.
|
||||||
#define LOOK_SWING_SCALE 0.5
|
#define LOOK_SWING_SCALE 0.5
|
||||||
|
|
||||||
//How fast the saber needs to be physically swung in order to trigger sounds and trails
|
//How fast the saber needs to be physically swung in order to trigger sounds and trails
|
||||||
#define SABER_ACTIVATE_VELOCITY 1.0f
|
#define SABER_ACTIVATE_VELOCITY 0.6f
|
||||||
|
|
||||||
#include "animtable.h"
|
#include "animtable.h"
|
||||||
|
|
||||||
|
@ -4676,6 +4676,8 @@ Ghoul2 Insert End
|
||||||
|
|
||||||
#define SABER_TRAIL_TIME 60.0f
|
#define SABER_TRAIL_TIME 60.0f
|
||||||
|
|
||||||
|
bool saberInAction = (saberTrail->inAction || (vr->primaryswingvelocity > SABER_ACTIVATE_VELOCITY));
|
||||||
|
|
||||||
// if we happen to be timescaled or running in a high framerate situation, we don't want to flood
|
// if we happen to be timescaled or running in a high framerate situation, we don't want to flood
|
||||||
// the system with very small trail slices...but perhaps doing it by distance would yield better results?
|
// the system with very small trail slices...but perhaps doing it by distance would yield better results?
|
||||||
if ( saberTrail->lastTime > cg.time )
|
if ( saberTrail->lastTime > cg.time )
|
||||||
|
@ -4685,11 +4687,10 @@ Ghoul2 Insert End
|
||||||
//cap it to cg.time here
|
//cap it to cg.time here
|
||||||
saberTrail->lastTime = cg.time;
|
saberTrail->lastTime = cg.time;
|
||||||
}
|
}
|
||||||
if ( cg.time > saberTrail->lastTime + 2 && saberTrail->inAction ) // 2ms
|
if ( cg.time > saberTrail->lastTime + 2 && saberInAction) // 2ms
|
||||||
{
|
{
|
||||||
//Swinging the saber quick enough to trigger a sound should also invoke trails
|
//Swinging the saber quick enough to trigger a sound should also invoke trails
|
||||||
if ( (saberTrail->inAction || (vr->primaryswingvelocity > SABER_ACTIVATE_VELOCITY)) &&
|
if ( saberInAction && cg.time < saberTrail->lastTime + 300 ) // if we have a stale segment, don't draw until we have a fresh one
|
||||||
cg.time < saberTrail->lastTime + 300 ) // if we have a stale segment, don't draw until we have a fresh one
|
|
||||||
{
|
{
|
||||||
vec3_t rgb1={255,255,255};
|
vec3_t rgb1={255,255,255};
|
||||||
|
|
||||||
|
|
|
@ -745,8 +745,8 @@ window_t WIN_Init( const windowDesc_t *windowDesc, glconfig_t *glConfig )
|
||||||
|
|
||||||
// Window render surface cvars
|
// Window render surface cvars
|
||||||
r_stencilbits = Cvar_Get( "r_stencilbits", "8", CVAR_ARCHIVE_ND|CVAR_LATCH );
|
r_stencilbits = Cvar_Get( "r_stencilbits", "8", CVAR_ARCHIVE_ND|CVAR_LATCH );
|
||||||
r_depthbits = Cvar_Get( "r_depthbits", "0", CVAR_ARCHIVE_ND|CVAR_LATCH );
|
r_depthbits = Cvar_Get( "r_depthbits", "24", CVAR_ARCHIVE_ND|CVAR_LATCH );
|
||||||
r_colorbits = Cvar_Get( "r_colorbits", "0", CVAR_ARCHIVE_ND|CVAR_LATCH );
|
r_colorbits = Cvar_Get( "r_colorbits", "32", CVAR_ARCHIVE_ND|CVAR_LATCH );
|
||||||
r_ignorehwgamma = Cvar_Get( "r_ignorehwgamma", "0", CVAR_ARCHIVE_ND|CVAR_LATCH );
|
r_ignorehwgamma = Cvar_Get( "r_ignorehwgamma", "0", CVAR_ARCHIVE_ND|CVAR_LATCH );
|
||||||
r_ext_multisample = Cvar_Get( "r_ext_multisample", "0", CVAR_ARCHIVE_ND|CVAR_LATCH );
|
r_ext_multisample = Cvar_Get( "r_ext_multisample", "0", CVAR_ARCHIVE_ND|CVAR_LATCH );
|
||||||
Cvar_Get( "r_availableModes", "", CVAR_ROM );
|
Cvar_Get( "r_availableModes", "", CVAR_ROM );
|
||||||
|
|
Loading…
Reference in a new issue