- backend changes from Raze, mainly to properly load keyboard presets.

This commit is contained in:
Christoph Oelckers 2020-06-07 15:09:10 +02:00
parent e81641dd01
commit 3fc0d0d794
6 changed files with 16 additions and 19 deletions

View file

@ -636,7 +636,7 @@ void F2DDrawer::AddPoly(FGameTexture *texture, FVector2 *points, int npoints,
void F2DDrawer::AddPoly(FGameTexture* img, FVector4* vt, size_t vtcount, unsigned int* ind, size_t idxcount, int translation, PalEntry color, FRenderStyle style, int clipx1, int clipy1, int clipx2, int clipy2) void F2DDrawer::AddPoly(FGameTexture* img, FVector4* vt, size_t vtcount, unsigned int* ind, size_t idxcount, int translation, PalEntry color, FRenderStyle style, int clipx1, int clipy1, int clipx2, int clipy2)
{ {
RenderCommand dg = {}; RenderCommand dg;
int method = 0; int method = 0;
dg.mType = DrawTypeTriangles; dg.mType = DrawTypeTriangles;

View file

@ -132,6 +132,7 @@ public:
FRenderStyle mRenderStyle; FRenderStyle mRenderStyle;
PalEntry mColor1; // Overlay color PalEntry mColor1; // Overlay color
ETexMode mDrawMode; ETexMode mDrawMode;
uint8_t mLightLevel;
uint8_t mFlags; uint8_t mFlags;
RenderCommand() RenderCommand()
@ -152,6 +153,7 @@ public:
mRenderStyle == other.mRenderStyle && mRenderStyle == other.mRenderStyle &&
mDrawMode == other.mDrawMode && mDrawMode == other.mDrawMode &&
mFlags == other.mFlags && mFlags == other.mFlags &&
mLightLevel == other.mLightLevel &&
mColor1.d == other.mColor1.d; mColor1.d == other.mColor1.d;
} }

View file

@ -40,7 +40,6 @@
#include "texturemanager.h" #include "texturemanager.h"
#include "r_videoscale.h" #include "r_videoscale.h"
#include "c_cvars.h" #include "c_cvars.h"
#include "intrect.h"
EXTERN_CVAR(Int, vid_aspect) EXTERN_CVAR(Int, vid_aspect)
EXTERN_CVAR(Int, uiscale) EXTERN_CVAR(Int, uiscale)

View file

@ -716,13 +716,8 @@ void C_SetDefaultKeys(const char* baseconfig)
while ((lump = fileSystem.FindLumpFullName(baseconfig, &lastlump)) != -1) while ((lump = fileSystem.FindLumpFullName(baseconfig, &lastlump)) != -1)
{ {
if (fileSystem.GetFileContainer(lump) > 0) break; // Read this only from the main game resources.
// [SW] - We need to check to see the origin of the DEFBINDS... if it if (fileSystem.GetFileContainer(lump) <= fileSystem.GetMaxIwadNum())
// Comes from an IWAD/IPK3/IPK7 allow it to override the users settings...
// If it comes from a user mod however, don't.
if (fileSystem.GetFileContainer(lump) > fileSystem.GetMaxIwadNum())
ReadBindings(lump, false);
else
ReadBindings(lump, true); ReadBindings(lump, true);
} }
@ -752,6 +747,13 @@ void C_BindDefaults()
C_SetDefaultKeys(cl_defaultconfiguration == 1 ? "engine/origbinds.txt" : cl_defaultconfiguration == 2 ? "engine/leftbinds.txt" : "engine/defbinds.txt"); C_SetDefaultKeys(cl_defaultconfiguration == 1 ? "engine/origbinds.txt" : cl_defaultconfiguration == 2 ? "engine/leftbinds.txt" : "engine/defbinds.txt");
} }
void C_SetDefaultBindings()
{
C_UnbindAll();
C_BindDefaults();
}
CCMD(controlpreset) CCMD(controlpreset)
{ {
if (argv.argc() < 2) if (argv.argc() < 2)
@ -762,7 +764,7 @@ CCMD(controlpreset)
int v = atoi(argv[1]); int v = atoi(argv[1]);
if (v < 0 || v > 2) return; if (v < 0 || v > 2) return;
cl_defaultconfiguration = v; cl_defaultconfiguration = v;
C_BindDefaults(); C_SetDefaultBindings();
} }
CCMD(binddefaults) CCMD(binddefaults)
@ -770,12 +772,6 @@ CCMD(binddefaults)
C_BindDefaults(); C_BindDefaults();
} }
void C_SetDefaultBindings()
{
C_UnbindAll();
C_BindDefaults();
}
//============================================================================= //=============================================================================
// //
// //

View file

@ -73,7 +73,7 @@ int HWViewpointBuffer::Bind(FRenderState &di, unsigned int index)
return index; return index;
} }
void HWViewpointBuffer::Set2D(FRenderState &di, int width, int height) void HWViewpointBuffer::Set2D(FRenderState &di, int width, int height, int pll)
{ {
if (width != m2DWidth || height != m2DHeight) if (width != m2DWidth || height != m2DHeight)
{ {
@ -83,7 +83,7 @@ void HWViewpointBuffer::Set2D(FRenderState &di, int width, int height)
matrices.mNormalViewMatrix.loadIdentity(); matrices.mNormalViewMatrix.loadIdentity();
matrices.mViewHeight = 0; matrices.mViewHeight = 0;
matrices.mGlobVis = 1.f; matrices.mGlobVis = 1.f;
matrices.mPalLightLevels = 0; matrices.mPalLightLevels = pll;
matrices.mClipLine.X = -10000000.0f; matrices.mClipLine.X = -10000000.0f;
matrices.mShadowmapFilter = gl_shadowmap_filter; matrices.mShadowmapFilter = gl_shadowmap_filter;

View file

@ -28,7 +28,7 @@ public:
~HWViewpointBuffer(); ~HWViewpointBuffer();
void Clear(); void Clear();
int Bind(FRenderState &di, unsigned int index); int Bind(FRenderState &di, unsigned int index);
void Set2D(FRenderState &di, int width, int height); void Set2D(FRenderState &di, int width, int height, int pll = 0);
int SetViewpoint(FRenderState &di, HWViewpointUniforms *vp); int SetViewpoint(FRenderState &di, HWViewpointUniforms *vp);
unsigned int GetBlockSize() const { return mBlockSize; } unsigned int GetBlockSize() const { return mBlockSize; }
}; };