mirror of
https://github.com/DrBeef/QuestZDoom.git
synced 2024-11-10 15:01:48 +00:00
Additional dyn lights changes
- Used correct dyn lights cvar now - Default ScreenSize to 11 (transparent / alternative HUD mode)
This commit is contained in:
parent
92c100b12e
commit
d739555967
25 changed files with 31 additions and 29 deletions
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.drbeef.questzdoom"
|
||||
android:versionCode="9"
|
||||
android:versionName="0.5.2" android:installLocation="auto" >
|
||||
android:versionCode="10"
|
||||
android:versionName="0.5.3" android:installLocation="auto" >
|
||||
|
||||
<!-- Tell the system this app requires OpenGL ES 3.1. -->
|
||||
<uses-feature android:glEsVersion="0x00030001" android:required="true"/>
|
||||
|
|
|
@ -81,12 +81,16 @@ static FMemArena DynLightArena(sizeof(FDynamicLight) * 200);
|
|||
static TArray<FDynamicLight*> FreeList;
|
||||
static FRandom randLight;
|
||||
|
||||
CUSTOM_CVAR (Bool, gl_lights, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
|
||||
//Default dynamic lights to false
|
||||
CUSTOM_CVAR (Bool, vr_dynlights, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
|
||||
{
|
||||
if (self) AActor::RecreateAllAttachedLights();
|
||||
else AActor::DeleteAllAttachedLights();
|
||||
}
|
||||
|
||||
//Original dynamic lights cvar does nothing
|
||||
CVAR (Bool, gl_lights, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//==========================================================================
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include "cycler.h"
|
||||
#include "g_levellocals.h"
|
||||
|
||||
EXTERN_CVAR(Bool, gl_lights)
|
||||
EXTERN_CVAR(Bool, vr_dynlights)
|
||||
|
||||
class FSerializer;
|
||||
|
||||
|
|
|
@ -284,7 +284,7 @@ void GLWall::DrawDecal(DBaseDecal *decal)
|
|||
}
|
||||
|
||||
// calculate dynamic light effect.
|
||||
if (gl_lights && GLRenderer->mLightCount && !mDrawer->FixedColormap && gl_light_sprites)
|
||||
if (vr_dynlights && GLRenderer->mLightCount && !mDrawer->FixedColormap && gl_light_sprites)
|
||||
{
|
||||
// Note: This should be replaced with proper shader based lighting.
|
||||
double x, y;
|
||||
|
|
|
@ -323,7 +323,7 @@ void GLSceneDrawer::RenderScene(int recursion)
|
|||
|
||||
// if we don't have a persistently mapped buffer, we have to process all the dynamic lights up front,
|
||||
// so that we don't have to do repeated map/unmap calls on the buffer.
|
||||
bool haslights = GLRenderer->mLightCount > 0 && FixedColormap == CM_DEFAULT && gl_lights;
|
||||
bool haslights = GLRenderer->mLightCount > 0 && FixedColormap == CM_DEFAULT && vr_dynlights;
|
||||
if (gl.lightmethod == LM_DEFERRED && haslights)
|
||||
{
|
||||
GLRenderer->mLights->Begin();
|
||||
|
|
|
@ -271,7 +271,7 @@ void GLSprite::Draw(int pass)
|
|||
{
|
||||
if (RenderStyle.BlendOp != STYLEOP_Shadow)
|
||||
{
|
||||
if (gl_lights && GLRenderer->mLightCount && mDrawer->FixedColormap == CM_DEFAULT && !fullbright)
|
||||
if (vr_dynlights && GLRenderer->mLightCount && mDrawer->FixedColormap == CM_DEFAULT && !fullbright)
|
||||
{
|
||||
if (!particle)
|
||||
{
|
||||
|
@ -356,7 +356,7 @@ void GLSprite::Draw(int pass)
|
|||
}
|
||||
if (RenderStyle.BlendOp != STYLEOP_Shadow)
|
||||
{
|
||||
if (gl_lights && GLRenderer->mLightCount && mDrawer->FixedColormap == CM_DEFAULT && !fullbright)
|
||||
if (vr_dynlights && GLRenderer->mLightCount && mDrawer->FixedColormap == CM_DEFAULT && !fullbright)
|
||||
{
|
||||
if (modelframe && !particle)
|
||||
dynlightindex = gl_SetDynModelLight(gl_light_sprites ? actor : NULL, dynlightindex);
|
||||
|
|
|
@ -493,7 +493,7 @@ void GLWall::RenderTranslucentWall()
|
|||
{
|
||||
if (gltexture)
|
||||
{
|
||||
if (mDrawer->FixedColormap == CM_DEFAULT && gl_lights && gl.lightmethod == LM_DIRECT)
|
||||
if (mDrawer->FixedColormap == CM_DEFAULT && vr_dynlights && gl.lightmethod == LM_DIRECT)
|
||||
{
|
||||
SetupLights();
|
||||
}
|
||||
|
|
|
@ -288,7 +288,7 @@ void GLSceneDrawer::SetupWeaponLight()
|
|||
if (psp->GetState() != nullptr)
|
||||
{
|
||||
// set the lighting parameters
|
||||
if (gl_lights && GLRenderer->mLightCount && FixedColormap == CM_DEFAULT && gl_light_sprites)
|
||||
if (vr_dynlights && GLRenderer->mLightCount && FixedColormap == CM_DEFAULT && gl_light_sprites)
|
||||
{
|
||||
FSpriteModelFrame *smf = playermo->player->ReadyWeapon ? FindModelFrame(playermo->player->ReadyWeapon->GetClass(), psp->GetState()->sprite, psp->GetState()->GetFrame(), false) : nullptr;
|
||||
if (smf)
|
||||
|
@ -539,7 +539,7 @@ void GLSceneDrawer::DrawPlayerSprites(sector_t * viewsector, bool hudModelStep)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (gl_lights && GLRenderer->mLightCount && FixedColormap == CM_DEFAULT && gl_light_sprites)
|
||||
if (vr_dynlights && GLRenderer->mLightCount && FixedColormap == CM_DEFAULT && gl_light_sprites)
|
||||
{
|
||||
FSpriteModelFrame *smf = playermo->player->ReadyWeapon ? FindModelFrame(playermo->player->ReadyWeapon->GetClass(), psp->GetSprite(), psp->GetState()->GetFrame(), false) : nullptr;
|
||||
if (smf)
|
||||
|
|
|
@ -71,9 +71,6 @@ CVAR(Bool, vr_switch_sticks, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
|||
CVAR(Float, vr_pickup_haptic_level, 0.2, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
||||
CVAR(Float, vr_quake_haptic_level, 0.8, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
||||
|
||||
//Our own control over dynamic lights
|
||||
CVAR(Bool, vr_dynlights, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
|
||||
|
||||
|
||||
//HUD control
|
||||
CVAR(Float, vr_hud_scale, 0.3f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
||||
|
|
|
@ -21,7 +21,9 @@ EXTERN_CVAR(Bool, gl_usefb)
|
|||
|
||||
EXTERN_CVAR(Int, gl_weaponlight)
|
||||
|
||||
EXTERN_CVAR (Bool, gl_lights);
|
||||
EXTERN_CVAR (Bool, vr_dynlights);
|
||||
|
||||
EXTERN_CVAR (Bool, gl_lights); // Now does nothing - replaced by our vr cvar
|
||||
EXTERN_CVAR (Bool, gl_lights_checkside);
|
||||
EXTERN_CVAR (Bool, gl_light_sprites);
|
||||
EXTERN_CVAR (Bool, gl_light_particles);
|
||||
|
|
|
@ -111,7 +111,7 @@ PolyModelRenderer::PolyModelRenderer(PolyRenderThread *thread, const Mat4f &worl
|
|||
|
||||
void PolyModelRenderer::AddLights(AActor *actor)
|
||||
{
|
||||
if (vr_dynlights && actor)
|
||||
if (r_dynlights && actor)
|
||||
{
|
||||
auto &addedLights = Thread->AddedLightsArray;
|
||||
|
||||
|
|
|
@ -269,7 +269,7 @@ void RenderPolyPlane::SetLightLevel(PolyRenderThread *thread, PolyDrawArgs &args
|
|||
|
||||
void RenderPolyPlane::SetDynLights(PolyRenderThread *thread, PolyDrawArgs &args, subsector_t *sub, bool ceiling)
|
||||
{
|
||||
if (!vr_dynlights)
|
||||
if (!r_dynlights)
|
||||
{
|
||||
args.SetLights(nullptr, 0);
|
||||
return;
|
||||
|
|
|
@ -372,7 +372,7 @@ FTexture *RenderPolySprite::GetSpriteTexture(AActor *thing, /*out*/ bool &flipX)
|
|||
void RenderPolySprite::SetDynlight(AActor *thing, PolyDrawArgs &args)
|
||||
{
|
||||
bool fullbrightSprite = ((thing->renderflags & RF_FULLBRIGHT) || (thing->flags5 & MF5_BRIGHT));
|
||||
if (fullbrightSprite || !vr_dynlights)
|
||||
if (fullbrightSprite || !r_dynlights)
|
||||
{
|
||||
args.SetDynLightColor(0);
|
||||
return;
|
||||
|
|
|
@ -405,7 +405,7 @@ void RenderPolyWall::Render(PolyRenderThread *thread)
|
|||
|
||||
void RenderPolyWall::SetDynLights(PolyRenderThread *thread, PolyDrawArgs &args)
|
||||
{
|
||||
if (!vr_dynlights)
|
||||
if (!r_dynlights)
|
||||
{
|
||||
args.SetLights(nullptr, 0);
|
||||
return;
|
||||
|
|
|
@ -361,7 +361,7 @@ double R_GetGlobVis(const FViewWindow &viewwindow, double vis)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
CUSTOM_CVAR (Int, screenblocks, 10, CVAR_ARCHIVE)
|
||||
CUSTOM_CVAR (Int, screenblocks, 11, CVAR_ARCHIVE)
|
||||
{
|
||||
if (self > 12)
|
||||
self = 12;
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
#include "r_thread.h"
|
||||
#include "swrenderer/scene/r_light.h"
|
||||
|
||||
CVAR(Bool, r_dynlights, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG); // Now does nothing in VR
|
||||
CVAR(Bool, r_dynlights, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
|
||||
CVAR(Bool, r_fuzzscale, 1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG);
|
||||
|
||||
namespace swrenderer
|
||||
|
|
|
@ -16,7 +16,7 @@ EXTERN_CVAR(Float, r_lod_bias);
|
|||
EXTERN_CVAR(Int, r_drawfuzz);
|
||||
EXTERN_CVAR(Bool, r_drawtrans);
|
||||
EXTERN_CVAR(Float, transsouls);
|
||||
EXTERN_CVAR(Bool, vr_dynlights);
|
||||
EXTERN_CVAR(Bool, r_dynlights);
|
||||
EXTERN_CVAR(Bool, r_fuzzscale);
|
||||
|
||||
class DrawerCommandQueue;
|
||||
|
|
|
@ -185,7 +185,7 @@ namespace swrenderer
|
|||
float zcol = 1.0f / wcol;
|
||||
float zbufferdepth = 1.0f / (zcol / Thread->Viewport->viewwindow.FocalTangent);
|
||||
|
||||
if (vr_dynlights && light_list)
|
||||
if (r_dynlights && light_list)
|
||||
{
|
||||
auto viewport = Thread->Viewport.get();
|
||||
|
||||
|
|
|
@ -203,7 +203,7 @@ namespace swrenderer
|
|||
drawerargs.SetLight(basecolormap, (float)(GlobVis * fabs(viewport->CenterY - y)), planeshade);
|
||||
}
|
||||
|
||||
if (vr_dynlights)
|
||||
if (r_dynlights)
|
||||
{
|
||||
int tx = x1;
|
||||
bool mirror = !!(Thread->Portal->MirrorFlags & RF_XFLIP);
|
||||
|
|
|
@ -67,7 +67,7 @@ namespace swrenderer
|
|||
|
||||
void VisiblePlane::AddLights(RenderThread *thread, FLightNode *node)
|
||||
{
|
||||
if (!vr_dynlights)
|
||||
if (!r_dynlights)
|
||||
return;
|
||||
|
||||
CameraLight *cameraLight = CameraLight::Instance();
|
||||
|
|
|
@ -152,7 +152,7 @@ namespace swrenderer
|
|||
|
||||
void SWModelRenderer::AddLights(AActor *actor)
|
||||
{
|
||||
if (vr_dynlights && actor)
|
||||
if (r_dynlights && actor)
|
||||
{
|
||||
auto &addedLights = Thread->AddedLightsArray;
|
||||
|
||||
|
|
|
@ -246,7 +246,7 @@ namespace swrenderer
|
|||
bool fullbright = !vis->foggy && ((renderflags & RF_FULLBRIGHT) || (thing->flags5 & MF5_BRIGHT));
|
||||
bool fadeToBlack = (vis->RenderStyle.Flags & STYLEF_FadeToBlack) != 0;
|
||||
|
||||
if (vr_dynlights && gl_light_sprites)
|
||||
if (r_dynlights && gl_light_sprites)
|
||||
{
|
||||
float lit_red = 0;
|
||||
float lit_green = 0;
|
||||
|
|
|
@ -41,7 +41,7 @@ const char *GetVersionString();
|
|||
|
||||
/** Lots of different version numbers **/
|
||||
|
||||
#define VERSIONSTR "DrBeef's QuestZDoom-0.5.2 (LZDoom 3.83a)"
|
||||
#define VERSIONSTR "DrBeef's QuestZDoom-0.5.3 (LZDoom 3.83a)"
|
||||
|
||||
// The version as seen in the Windows resource
|
||||
#define RC_FILEVERSION 3,83,1
|
||||
|
|
|
@ -2619,7 +2619,6 @@ OptionMenu "GLTextureGLOptions" protected
|
|||
OptionMenu "GLLightOptions" protected
|
||||
{
|
||||
Title "$GLLIGHTMNU_TITLE"
|
||||
Option "$GLLIGHTMNU_LIGHTSENABLED", gl_lights, "OnOff"
|
||||
Option "$GLLIGHTMNU_CLIPLIGHTS", gl_lights_checkside, "YesNo"
|
||||
Option "$GLLIGHTMNU_LIGHTSPRITES", gl_light_sprites, "YesNo"
|
||||
Option "$GLLIGHTMNU_LIGHTPARTICLES", gl_light_particles, "YesNo"
|
||||
|
|
Binary file not shown.
Loading…
Reference in a new issue