- added Build's NPOT emulation to the backend.

For GZDoom this is completely disabled, of course, because the Doom engine does not need it, but in order to have the same backend code in both engines it needs to be present.
This commit is contained in:
Christoph Oelckers 2020-06-08 08:01:56 +02:00
commit 9e51a2f63c
7 changed files with 164 additions and 98 deletions

View file

@ -4,6 +4,7 @@
#include "matrix.h"
#include "hw_material.h"
#include "texmanip.h"
#include "version.h"
struct FColormap;
class IVertexBuffer;
@ -198,6 +199,9 @@ struct StreamData
FVector4 uSplitBottomPlane;
FVector4 uDetailParms;
#ifdef NPOT_EMULATION
FVector2 uNpotEmulation;
#endif
};
class FRenderState
@ -289,7 +293,9 @@ public:
mStreamData.uSplitBottomPlane = { 0.0f, 0.0f, 0.0f, 0.0f };
mStreamData.uDynLightColor = { 0.0f, 0.0f, 0.0f, 0.0f };
mStreamData.uDetailParms = { 0.0f, 0.0f, 0.0f, 0.0f };
#ifdef NPOT_EMULATION
mStreamData.uNpotEmulation = { 0,0 };
#endif
mModelMatrix.loadIdentity();
mTextureMatrix.loadIdentity();
ClearClipSplit();
@ -472,6 +478,13 @@ public:
mStreamData.uAddColor = pe;
}
void SetNpotEmulation(float factor, float offset)
{
#ifdef NPOT_EMULATION
mStreamData.uNpotEmulation = { offset, factor };
#endif
}
void ApplyTextureManipulation(TextureManipulation* texfx)
{
if (!texfx || texfx->AddColor.a == 0)