- major dependency reduction of the texture system.
This commit is contained in:
parent
ab77416ddc
commit
f8e9cb8fbc
103 changed files with 820 additions and 712 deletions
|
|
@ -43,6 +43,7 @@
|
|||
#include "r_sky.h"
|
||||
#include "colormaps.h"
|
||||
#include "templates.h"
|
||||
#include "c_cvars.h"
|
||||
|
||||
CUSTOM_CVAR(Bool, cl_customizeinvulmap, false, CVAR_ARCHIVE|CVAR_NOINITCALL)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@
|
|||
#include "textures/skyboxtexture.h"
|
||||
#include "hwrenderer/postprocessing/hw_postprocessshader.h"
|
||||
#include "hwrenderer/textures/hw_material.h"
|
||||
#include "texturemanager.h"
|
||||
|
||||
void AddLightDefaults(FLightDefaults *defaults, double attnFactor);
|
||||
void AddLightAssociation(const char *actor, const char *frame, const char *light);
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
#include "r_data/models/models_ue1.h"
|
||||
#include "r_data/models/models_obj.h"
|
||||
#include "i_time.h"
|
||||
#include "texturemanager.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:4244) // warning C4244: conversion from 'double' to 'float', possible loss of data
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
#include "filesystem.h"
|
||||
#include "r_data/models/models.h"
|
||||
#include "texturemanager.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:4244) // warning C4244: conversion from 'double' to 'float', possible loss of data
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
#include "filesystem.h"
|
||||
#include "cmdlib.h"
|
||||
#include "r_data/models/models.h"
|
||||
#include "texturemanager.h"
|
||||
|
||||
#define MAX_QPATH 64
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include "filesystem.h"
|
||||
#include "r_data/models/models_obj.h"
|
||||
#include "texturemanager.h"
|
||||
|
||||
/**
|
||||
* Load an OBJ model
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
#include "filesystem.h"
|
||||
#include "cmdlib.h"
|
||||
#include "r_data/models/models_ue1.h"
|
||||
#include "texturemanager.h"
|
||||
|
||||
float unpackuvert( uint32_t n, int c )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
#include "g_levellocals.h"
|
||||
#include "models.h"
|
||||
#include "image.h"
|
||||
#include "texturemanager.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(disable:4244) // warning C4244: conversion from 'double' to 'float', possible loss of data
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
#include "r_canvastexture.h"
|
||||
#include "g_levellocals.h"
|
||||
#include "serializer.h"
|
||||
#include "texturemanager.h"
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
|
|
|
|||
|
|
@ -46,77 +46,6 @@ int R_FindCustomTranslation(FName name);
|
|||
void R_ParseTrnslate();
|
||||
void StaticSerializeTranslations(FSerializer& arc);
|
||||
|
||||
struct TextureManipulation
|
||||
{
|
||||
enum
|
||||
{
|
||||
BlendNone = 0,
|
||||
BlendAlpha = 1,
|
||||
BlendScreen = 2,
|
||||
BlendOverlay = 3,
|
||||
BlendHardLight = 4,
|
||||
BlendMask = 7,
|
||||
InvertBit = 8,
|
||||
ActiveBit = 16, // Must be set for the shader to do something
|
||||
};
|
||||
PalEntry AddColor; // Alpha contains the blend flags
|
||||
PalEntry ModulateColor; // Alpha may contain a multiplier to get higher values than 1.0 without promoting this to 4 full floats.
|
||||
PalEntry BlendColor;
|
||||
float DesaturationFactor;
|
||||
|
||||
bool CheckIfEnabled() // check if this manipulation is doing something. NoOps do not need to be preserved, unless they override older setttings.
|
||||
{
|
||||
if (AddColor != 0 || // this includes a check for the blend mode without which BlendColor is not active
|
||||
ModulateColor != 0x01ffffff || // 1 in alpha must be the default for a no-op.
|
||||
DesaturationFactor != 0)
|
||||
{
|
||||
AddColor.a |= ActiveBit; // mark as active for the shader's benefit.
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void SetTextureModulateColor(int slot, PalEntry rgb)
|
||||
{
|
||||
rgb.a = ModulateColor.a;
|
||||
ModulateColor = rgb;
|
||||
}
|
||||
|
||||
void SetTextureModulateScaleFactor(int slot, int fac)
|
||||
{
|
||||
ModulateColor.a = (uint8_t)fac;
|
||||
}
|
||||
|
||||
void SetTextureAdditiveColor(int slot, PalEntry rgb)
|
||||
{
|
||||
rgb.a = AddColor.a;
|
||||
AddColor = rgb;
|
||||
}
|
||||
|
||||
void SetTextureBlendColor(int slot, PalEntry rgb)
|
||||
{
|
||||
BlendColor = rgb;
|
||||
}
|
||||
|
||||
void SetTextureDesaturationFactor(int slot, double fac)
|
||||
{
|
||||
DesaturationFactor = (float)fac;
|
||||
}
|
||||
|
||||
void SetTextureBlendMode(int slot, int mode)
|
||||
{
|
||||
AddColor.a = (AddColor.a & ~TextureManipulation::BlendMask) | (mode & TextureManipulation::BlendMask);
|
||||
}
|
||||
|
||||
void SetTextureInvert(bool on)
|
||||
{
|
||||
AddColor.a |= TextureManipulation::InvertBit;
|
||||
AddColor.a &= ~TextureManipulation::InvertBit;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // __R_TRANSLATE_H
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
#include "r_data/sprites.h"
|
||||
#include "r_data/voxels.h"
|
||||
#include "vm.h"
|
||||
#include "texturemanager.h"
|
||||
|
||||
void InitModels();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue