mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 00:41:55 +00:00
- menu entries for light modes, plus handling of overbright shades.
This commit is contained in:
parent
f20bd94269
commit
e5dad53f6d
7 changed files with 831 additions and 789 deletions
|
@ -44,7 +44,7 @@
|
|||
#include "printf.h"
|
||||
|
||||
|
||||
CUSTOM_CVAR(Int, gl_fogmode, 1, CVAR_ARCHIVE | CVAR_NOINITCALL)
|
||||
CUSTOM_CVAR(Int, gl_fogmode, 2, CVAR_ARCHIVE | CVAR_NOINITCALL)
|
||||
{
|
||||
if (self > 2) self = 2;
|
||||
if (self < 0) self = 0;
|
||||
|
|
|
@ -140,7 +140,10 @@ float HWDrawInfo::GetFogDensity(int lightlevel, PalEntry fogcolor, int sectorfog
|
|||
else if ((fogcolor.d & 0xffffff) == 0)
|
||||
{
|
||||
// case 2: black fog
|
||||
density = distfogtable[hw_ClampLight(lightlevel)];
|
||||
if (lightlevel > 255)
|
||||
density = max(0.f, distfogtable[255] * (1.f - (lightlevel - 255.f) / 192.f));
|
||||
else
|
||||
density = distfogtable[hw_ClampLight(lightlevel)];
|
||||
}
|
||||
#if 0
|
||||
else if (Level->outsidefogdensity != 0 && APART(Level->info->outsidefog) != 0xff && (fogcolor.d & 0xffffff) == (Level->info->outsidefog & 0xffffff))
|
||||
|
|
|
@ -30,7 +30,10 @@
|
|||
#include "hw_portal.h"
|
||||
#include "hw_cvars.h"
|
||||
|
||||
CVAR(Int, hw_lightmode, 0, CVAR_ARCHIVE)
|
||||
CUSTOM_CVAR(Int, hw_lightmode, 0, CVAR_ARCHIVE) // this is intentionally per game.
|
||||
{
|
||||
if (self < 0 || self > 2 || (isExhumed() && self != 0)) self = 0;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
|
@ -160,15 +163,14 @@ void SetLightAndFog(HWDrawInfo* di, FRenderState& state, PalEntry fade, int pale
|
|||
|
||||
if (!di->isBuildSoftwareLighting() && !foggy)
|
||||
{
|
||||
bool fullbright = ShadeDiv < 1 / 1000.f || g_visibility == 0;
|
||||
bool fullbright = ShadeDiv < 1 / 1000.f || g_visibility == 0 || shade < -numshades;
|
||||
float inverselight = shade * 255.f / numshades;
|
||||
if (inverselight < 0) fullbright = true;
|
||||
if (!fullbright) inverselight /= ShadeDiv;
|
||||
int lightlevel = !fullbright ? clamp(int(255 - inverselight), 0, 255) : 255;
|
||||
|
||||
FColormap cm = { 0xffffffff };
|
||||
di->SetColor(state, lightlevel, di->rellight, fullbright, cm, alpha);
|
||||
di->SetFog(state, lightlevel, visibility * di->visibility, fullbright, &cm, false);
|
||||
di->SetFog(state, 255 - inverselight, visibility * di->visibility, fullbright, &cm, false);
|
||||
return;
|
||||
}
|
||||
// Fog must be done before the texture so that the texture selector can override it.
|
||||
|
|
|
@ -177,6 +177,13 @@ void HWWall::RenderMirrorSurface(HWDrawInfo *di, FRenderState &state)
|
|||
|
||||
void HWWall::RenderTexturedWall(HWDrawInfo *di, FRenderState &state, int rflags)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
if (seg && (wallnum(seg) == 929 || wallnum(seg) == 930))
|
||||
{
|
||||
int a = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
SetLightAndFog(di, state, fade, palette, shade, visibility, alpha);
|
||||
|
||||
state.SetMaterial(texture, UF_Texture, 0, (flags & (HWF_CLAMPX | HWF_CLAMPY)), TRANSLATION(Translation_Remap + curbasepal, palette), -1);
|
||||
|
@ -898,7 +905,7 @@ void HWWall::Process(HWDrawInfo* di, walltype* wal, sectortype* frontsector, sec
|
|||
|
||||
|
||||
#ifdef _DEBUG
|
||||
if (wallnum(wal) == 3312)
|
||||
if (wallnum(wal) == 929 || wallnum(wal) == 930)
|
||||
{
|
||||
int a = 0;
|
||||
}
|
||||
|
|
|
@ -796,4 +796,8 @@ Line alpha,AUTOMAPMNU_LINEALPHA,,,,Průhlednost čar,Alpha für Linien,,Linia tr
|
|||
Line thickness,AUTOMAPMNU_LINETHICKNESS,,,,Tloušťka čar,Dicke der Linien,,Linia dikeco,Grosor de línea,,,,,,,,,Grubość Linii,Espessura da linha,,Grosime linii,,
|
||||
Rendering quality,GLPREFMNU_RENDERQUALITY,,,,Kvalita vykreslování,Renderqualität,,Kvalito de bildigado,Calidad de Renderizado,,Hahmonnuslaatu,Qualité du rendu,Renderelés minősége,Qualità resa grafica,レンダリング品質,렌더링 품질,Het teruggeven van kwaliteit,Jakość Renderowania,Qualidade de renderização,,Calitate video,Качество рендеринга,Квалитет рендовања
|
||||
Speed,OPTVAL_SPEED,,,,Rychlost,Geschwindigkeit,,Rapido,Velocidad,,Nopeus,Vitesse,Sebesség,Velocità,速度寄り,성능,Snelheid,Szybkość,Velocidade,,Viteză,Скорость,Брзина
|
||||
Quality,OPTVAL_QUALITY,,,,Kvalita,Qualität,,Kvalito,Calidad,,Laatu,Qualité,Minőség,Qualità,品質寄り,고품질,Kwaliteit,Jakość,Qualidade,,Calitate,Качество,Квалитет
|
||||
Quality,OPTVAL_QUALITY,,,,Kvalita,Qualität,,Kvalito,Calidad,,Laatu,Qualité,Minőség,Qualità,品質寄り,고품질,Kwaliteit,Jakość,Qualidade,,Calitate,Качество,Квалитет
|
||||
Sector light mode,GLPREFMNU_SECLIGHTMODE,,,,Režim osvětlení sektorů,Sektorlichtmodus,,Reĝimo de sektorlumo,Modo de luz de sector,,Sektorivalojen tila,Mode de lumière Secteur,Szektor fény mód,Modalità luce di settore,セクターライトモード,섹터 조명 모드,Sector lichte wijze,Tryb oświetlenia sektorów,Modo de luz de setor,,Mod iluminare sectorial,Режим освещения секторов,Секторско светло мод
|
||||
Fog mode,GLPREFMNU_FOGMODE,,,,Režim mlhy,Nebelmodus,,Reĝimo de nebulo,Modo de niebla,,Sumutila,Mode du broullard,Köd mód,Modalità nebbia,フォグモード,안개 모드,Mistmodus,Tryb mgły,Modo de neblina,,Mod ceață,Режим тумана,Магла мод
|
||||
Radial,OPTVAL_RADIAL,,,,Radiální,,Ακτινικό,Radiusa,,,Säteittäinen,,Sugaras,Radiale,放射状,방사형,Radiaal,Promieniowe,,,Radială,Радиальный,Радијално
|
||||
Standard,OPTVAL_STANDARD,,,,Standardní,,,Norma,Estándar,,Normaali,,Szabvány,Standard,標準,기본,Standaard,Standard,Padrão,,,Стандартный,Стандардно
|
File diff suppressed because it is too large
Load diff
|
@ -1176,6 +1176,20 @@ OptionValue "HqResizeModesNoMMX"
|
|||
6, "$OPTVAL_NORMALNX"
|
||||
}
|
||||
|
||||
OptionValue "FogMode"
|
||||
{
|
||||
0, "$OPTVAL_OFF"
|
||||
1, "$OPTVAL_STANDARD"
|
||||
2, "$OPTVAL_RADIAL"
|
||||
}
|
||||
|
||||
OptionValue "LightModes"
|
||||
{
|
||||
0, "$GLPREFMNU_ORIGINAL"
|
||||
1, "$GLPREFMNU_NATURAL"
|
||||
2, "$GLPREFMNU_HIGHCONTRAST"
|
||||
}
|
||||
|
||||
OptionMenu "PostProcessMenu"
|
||||
{
|
||||
Title "$GLMNU_POSTPROCESS"
|
||||
|
@ -1310,8 +1324,14 @@ OptionMenu "RenderOptions"
|
|||
Option "$RENDER_TC", "hw_hightile", "OnOff"
|
||||
Option "$RENDER_CACHE", "r_precache", "OnOff"
|
||||
StaticText ""
|
||||
Option "$RENDER_PALETTEEMU", "hw_useindexedcolortextures", "OnOff"
|
||||
Option "$RENDER_PALINTER", "hw_shadeinterpolate", "OnOff", "hw_useindexedcolortextures"
|
||||
// Exhumed's lighting system does not work with the enhanced modes.
|
||||
ifnotgame(Exhumed)
|
||||
{
|
||||
Option "$GLPREFMNU_SECLIGHTMODE", "hw_lightmode", "LightModes"
|
||||
}
|
||||
Option "$GLPREFMNU_FOGMODE", gl_fogmode, "FogMode"
|
||||
Option "$RENDER_PALETTEEMU", "hw_useindexedcolortextures", "OnOff"
|
||||
Option "$RENDER_PALINTER", "hw_shadeinterpolate", "OnOff", "hw_useindexedcolortextures"
|
||||
StaticText ""
|
||||
Option "$RENDER_MODELS", "hw_models", "OnOff"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue