1
0
Fork 0
forked from fte/fteqw

added vid_conautoscale which allows vid_conheight/vid_conwiidth to be updated based on scale of current resolution, updated vc2005 project yet again

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2141 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
TimeServ 2006-04-02 07:14:25 +00:00
parent d0834bffc2
commit 1785c0bfc5
4 changed files with 46 additions and 18 deletions

View file

@ -118,6 +118,7 @@ cvar_t gl_nocolors = SCVAR("gl_nocolors","0");
cvar_t gl_load24bit = SCVARF("gl_load24bit", "1", CVAR_ARCHIVE);
cvar_t vid_conwidth = SCVARF("vid_conwidth", "640", CVAR_ARCHIVE);
cvar_t vid_conheight = SCVARF("vid_conheight", "480", CVAR_ARCHIVE);
cvar_t vid_conautoscale = SCVARF("vid_conautoscale", "0", CVAR_ARCHIVE);
cvar_t gl_nobind = SCVAR("gl_nobind", "0");
cvar_t gl_max_size = SCVAR("gl_max_size", "1024");
cvar_t gl_picmip = SCVAR("gl_picmip", "0");
@ -301,8 +302,6 @@ void GLRenderer_Init(void)
Cvar_Register (&gl_max_size, GLRENDEREROPTIONS);
Cvar_Register (&gl_maxdist, GLRENDEREROPTIONS);
Cvar_Register (&gl_mindist, GLRENDEREROPTIONS);
Cvar_Register (&vid_conwidth, GLRENDEREROPTIONS);
Cvar_Register (&vid_conheight, GLRENDEREROPTIONS);
Cvar_Register (&vid_multisample, GLRENDEREROPTIONS);
Cvar_Register (&gl_fontedgeclamp, GRAPHICALNICETIES);
@ -478,6 +477,10 @@ void Renderer_Init(void)
// Cvar_Register (&vid_stretch, VIDCOMMANDGROUP);
Cvar_Register (&vid_bpp, VIDCOMMANDGROUP);
Cvar_Register (&vid_conwidth, VIDCOMMANDGROUP);
Cvar_Register (&vid_conheight, VIDCOMMANDGROUP);
Cvar_Register (&vid_conautoscale, VIDCOMMANDGROUP);
Cvar_Register (&vid_allow_modex, VIDCOMMANDGROUP);
Cvar_Register (&vid_width, VIDCOMMANDGROUP);

View file

@ -15,8 +15,8 @@
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
OutputDirectory="..\gas2masm\Debug"
IntermediateDirectory="..\gas2masm\Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
UseOfMFC="0"
@ -45,10 +45,10 @@
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
RuntimeLibrary="1"
PrecompiledHeaderFile=".\Debug/gas2masm.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
PrecompiledHeaderFile="..\gas2masm\Debug\gas2masm.pch"
AssemblerListingLocation="..\gas2masm\Debug\"
ObjectFile="..\gas2masm\Debug\"
ProgramDataBaseFileName="..\gas2masm\Debug\"
WarningLevel="3"
SuppressStartupBanner="true"
DebugInformationFormat="4"
@ -66,11 +66,11 @@
/>
<Tool
Name="VCLinkerTool"
OutputFile=".\Debug/gas2masm.exe"
OutputFile="..\gas2masm\Debug\gas2masm.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/gas2masm.pdb"
ProgramDatabaseFile="..\gas2masm\Debug\gas2masm.pdb"
SubSystem="1"
TargetMachine="1"
/>

View file

@ -3755,6 +3755,7 @@ void GL_BuildLightmaps (void)
else
gl_lightmap_format = GL_LUMINANCE;
/*
if (COM_CheckParm ("-lm_1"))
gl_lightmap_format = GL_LUMINANCE;
if (COM_CheckParm ("-lm_a"))
@ -3765,7 +3766,7 @@ void GL_BuildLightmaps (void)
gl_lightmap_format = GL_RGB;
if (COM_CheckParm ("-lm_4"))
gl_lightmap_format = GL_RGBA;
/* if (*gl_lightmapmode.string)
if (*gl_lightmapmode.string)
{
switch(*gl_lightmapmode.string)
{

View file

@ -131,7 +131,7 @@ needs almost the entire 256k of stack space!
void GLSCR_UpdateScreen (void)
{
extern cvar_t vid_conwidth, vid_conheight, gl_texturemode;
extern cvar_t vid_conwidth, vid_conheight, gl_texturemode, vid_conautoscale;
int uimenu;
#ifdef TEXTEDITOR
extern qboolean editormodal;
@ -145,16 +145,40 @@ void GLSCR_UpdateScreen (void)
return;
}
if (vid_conautoscale.modified)
{
float xratio, yratio = 0;
xratio = vid_conautoscale.value;
if (xratio > 0)
{
char *s = strchr(vid_conautoscale.string, ' ');
if (s)
yratio = atof(s + 1);
if (yratio <= 0)
yratio = xratio;
xratio = 1 / xratio;
yratio = 1 / yratio;
Cvar_SetValue(&vid_conwidth, glwidth * xratio);
Cvar_SetValue(&vid_conheight, glheight * yratio);
}
vid_conautoscale.modified = false;
}
if (vid_conwidth.modified || vid_conheight.modified)
{
//let let the user be too crazy
if (vid_conwidth.value > 2048) //anything higher is unreadable.
Cvar_Set(&vid_conwidth, "2048");
if (vid_conwidth.value < 240) //lower would be wrong
if (vid_conwidth.value > (glwidth * 2)) //anything higher is unreadable.
Cvar_SetValue(&vid_conwidth, (float)(glwidth * 2));
if (vid_conwidth.value < 320) //lower would be wrong
Cvar_Set(&vid_conwidth, "320");
if (vid_conheight.value > 1536) //anything higher is unreadable.
Cvar_Set(&vid_conheight, "1536");
if (vid_conheight.value < 240) //lower would be wrong
if (vid_conheight.value > (glheight * 2)) //anything higher is unreadable.
Cvar_SetValue(&vid_conheight, (float)(glheight * 2));
if (vid_conheight.value < 200) //lower would be wrong
Cvar_Set(&vid_conheight, "200");
vid_conwidth.modified = false;