Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/coelckers/gzdoom
Browse files Browse the repository at this point in the history
  • Loading branch information
drfrag666 committed Jun 11, 2020
2 parents 46cf2e2 + 3e70610 commit 9bd05cb
Show file tree
Hide file tree
Showing 10 changed files with 233 additions and 219 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- {
name: "Visual Studio 32-bit",
os: windows-latest,
extra_options: "-A Win32",
extra_options: "-A Win32 -DFORCE_INTERNAL_ZLIB=ON",
build_type: "Release"
}
- {
Expand Down
2 changes: 1 addition & 1 deletion src/common/rendering/vulkan/shaders/vk_shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ std::unique_ptr<VulkanShader> VkShaderManager::LoadVertShader(FString shadername
code << defines;
code << "\n#define MAX_STREAM_DATA " << std::to_string(MAX_STREAM_DATA).c_str() << "\n";
#ifdef NPOT_EMULATION
code << "#define NPOT_EMULATION\n"
code << "#define NPOT_EMULATION\n";
#endif
code << shaderBindings;
if (!device->UsedDeviceFeatures.shaderClipDistance) code << "#define NO_CLIPDISTANCE_SUPPORT\n";
Expand Down
6 changes: 3 additions & 3 deletions src/common/utility/m_alloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
#endif

#ifndef _DEBUG
#if !defined(__solaris__) && !defined(__OpenBSD__)
#if !defined(__solaris__) && !defined(__OpenBSD__) && !defined(__DragonFly__)
void *M_Malloc(size_t size)
{
void *block = malloc(size);
Expand Down Expand Up @@ -124,7 +124,7 @@ void *M_Realloc(void *memblock, size_t size)
#include <crtdbg.h>
#endif

#if !defined(__solaris__) && !defined(__OpenBSD__)
#if !defined(__solaris__) && !defined(__OpenBSD__) && !defined(__DragonFly__)
void *M_Malloc_Dbg(size_t size, const char *file, int lineno)
{
void *block = _malloc_dbg(size, _NORMAL_BLOCK, file, lineno);
Expand Down Expand Up @@ -192,7 +192,7 @@ void *M_Realloc_Dbg(void *memblock, size_t size, const char *file, int lineno)
#endif
#endif

#if !defined(__solaris__) && !defined(__OpenBSD__)
#if !defined(__solaris__) && !defined(__OpenBSD__) && !defined(__DragonFly__)
void M_Free (void *block)
{
if (block != NULL)
Expand Down
12 changes: 10 additions & 2 deletions src/rendering/hwrenderer/scene/hw_drawinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,16 @@ void HWDrawInfo::StartScene(FRenderViewpoint &parentvp, HWViewpointUniforms *uni
VPUniforms.mViewMatrix.loadIdentity();
VPUniforms.mNormalViewMatrix.loadIdentity();
VPUniforms.mViewHeight = viewheight;
VPUniforms.mGlobVis = (float)R_GetGlobVis(r_viewwindow, r_visibility) / 32.f;
VPUniforms.mPalLightLevels = static_cast<int>(gl_bandedswlight) | (static_cast<int>(gl_fogmode) << 8) | ((int)lightmode << 16);
if (gl_lightmode == 5)
{
VPUniforms.mGlobVis = 1 / 64.f;
VPUniforms.mPalLightLevels = 32 | (static_cast<int>(gl_fogmode) << 8) | ((int)lightmode << 16);
}
else
{
VPUniforms.mGlobVis = (float)R_GetGlobVis(r_viewwindow, r_visibility) / 32.f;
VPUniforms.mPalLightLevels = static_cast<int>(gl_bandedswlight) | (static_cast<int>(gl_fogmode) << 8) | ((int)lightmode << 16);
}
VPUniforms.mClipLine.X = -10000000.0f;
VPUniforms.mShadowmapFilter = gl_shadowmap_filter;
}
Expand Down
2 changes: 1 addition & 1 deletion src/rendering/hwrenderer/scene/hw_lighting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ float HWDrawInfo::GetFogDensity(int lightlevel, PalEntry fogcolor, int sectorfog
else if ((fogcolor.d & 0xffffff) == 0)
{
// case 2: black fog
if ((!isSoftwareLighting() || blendfactor > 0) && !(Level->flags3 & LEVEL3_NOLIGHTFADE))
if ((!isDoomSoftwareLighting() || blendfactor > 0) && !(Level->flags3 & LEVEL3_NOLIGHTFADE))
{
density = distfogtable[lightmode != ELightMode::LinearStandard][hw_ClampLight(lightlevel)];
}
Expand Down
4 changes: 4 additions & 0 deletions src/rendering/hwrenderer/scene/hw_setcolor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ void HWDrawInfo::SetFog(FRenderState &state, int lightlevel, int rellight, bool
float light = (float)CalcLightLevel(lightlevel, rellight, false, cmap->BlendFactor);
SetShaderLight(state, light, lightlevel);
}
else if (lightmode == ELightMode::Build)
{
state.SetLightParms(0.2f * fogdensity, 1.f / 31.f);
}
else
{
state.SetLightParms(1.f, 0.f);
Expand Down
1 change: 1 addition & 0 deletions wadsrc/static/language.csv
Original file line number Diff line number Diff line change
Expand Up @@ -3798,6 +3798,7 @@ Custom Inverse Map,DSPLYMNU_CUSTOMINVERTMAP,,,,Vlastní inverzní mapa,Benutzerd
",,Mukautettu käänteinen tumma väri,Couleur foncée pour l'inversion,,Colore inverso personalizzato scuro,カスタム反転色 暗め,사용자 지정 어두운 반전 색상,Donkere kleur voor inversie,Ciemny kolor do inwersji,Personalizar Cores Invertidas - Cor escura,,Personalizare Culoare Inverse Map Întunecată,Темный цвет,Прилагођена инверзна боја тамна
Custom Inverse Color Light,DSPLYMNU_CUSTOMINVERTC2,,,Custom Inverse Colour Light,Vlastní inverzní světlá barva,Helle Farbe für Invertierung,Προσαρμοσμένος Ανάποδο Χρώμα Φωτεινό,Agorda Mala Kolorhelo,Color Claro de Filtro Invertido,,"Mukautettu käänteinen vaalea väri
",Couleur claire pour l'inversion,,Luce inversa di colore personalizzata,カスタム反転色 明るめ,사용자 지정 밝은 반전 색상,Lichte kleur voor inversie,Jasny kolor do inwersji,Personalizar Cores Invertidas - Cor clara,,Personalizare Culoare Inverse Map Deschisă,Светлый цвет,Прилагођено инверзно светло у боји
View bob amount when firing,DSPLYMNU_BOBFIRE,,,,,Waffenpendeln beim Schießen,,,,,,,,,,,,,,,,,
Preferred Rendering API,VIDMNU_PREFERBACKEND,,,,Upřednostňované renderovací API,Bevorzugtes Render API,Προτιμούμενο Rendering API,Preferita Bildigado de API,API de Renderizado Preferida,,Ensisijainen hahmonnuksen ohjelmointirajapinta,API de rendu préférée,,API di rendering preferita,優先レンダリングAPI,기본적인 API 랜더링,Voorkeur render-API,Preferowany interfejs API renderowania,API de Renderização Preferida,,API Video Preferat,Предпочтительный интерфейс рендеринга,Преферред АПИ приказивања
OpenGL,OPTVAL_OPENGL,,,,,,,,,,,,,,,,,,,,,,
Vulkan,OPTVAL_VULKAN,,,,,,,,,,,,,,,,,,,,,,
Expand Down
1 change: 1 addition & 0 deletions wadsrc/static/menudef.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2425,6 +2425,7 @@ OptionValue "LightingModes"
2, "$OPTVAL_DOOM"
3, "$OPTVAL_DARK"
4, "$OPTVAL_LEGACY"
5, "$OPTVAL_BUILD"
8, "$OPTVAL_SOFTWARE"
16, "$OPTVAL_VANILLA"
}
Expand Down
2 changes: 1 addition & 1 deletion wadsrc/static/shaders/glsl/main.fp
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ float R_DoomLightingEquation(float light)
{
// This is a lot more primitive than Doom's lighting...
float numShades = float(uPalLightLevels & 255);
float curshade = (1.0 - light) / (numShades - 1.0);
float curshade = (1.0 - light) * (numShades - 1.0);
float visibility = max(uGlobVis * uLightFactor * z, 0.0);
float shade = clamp((curshade + visibility), 0.0, numShades - 1.0);
return clamp(shade * uLightDist, 0.0, 1.0);
Expand Down
Loading

0 comments on commit 9bd05cb

Please sign in to comment.