mirror of
https://github.com/ZDoom/Raze.git
synced 2025-01-18 22:51:50 +00:00
- moved shadeToLight out of build.h.
This commit is contained in:
parent
957f7e9487
commit
168b0385cf
11 changed files with 24 additions and 27 deletions
|
@ -190,17 +190,8 @@ EXTERN int32_t display_mirror;
|
||||||
|
|
||||||
EXTERN int32_t randomseed;
|
EXTERN int32_t randomseed;
|
||||||
|
|
||||||
EXTERN int16_t numshades;
|
|
||||||
EXTERN uint8_t paletteloaded;
|
EXTERN uint8_t paletteloaded;
|
||||||
|
|
||||||
// Return type is int because this gets passed to variadic functions where structs may produce undefined behavior.
|
|
||||||
inline int shadeToLight(int shade)
|
|
||||||
{
|
|
||||||
shade = clamp(shade, 0, numshades-1);
|
|
||||||
int light = Scale(numshades-1-shade, 255, numshades-1);
|
|
||||||
return PalEntry(255,light,light,light);
|
|
||||||
}
|
|
||||||
|
|
||||||
EXTERN int32_t maxspritesonscreen;
|
EXTERN int32_t maxspritesonscreen;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
@ -337,22 +328,8 @@ SPRITE VARIABLES:
|
||||||
be in some sector, and must have some kind of status that you define.
|
be in some sector, and must have some kind of status that you define.
|
||||||
|
|
||||||
|
|
||||||
TILE VARIABLES:
|
|
||||||
NUMTILES - the number of tiles found TILES.DAT.
|
|
||||||
|
|
||||||
TIMING VARIABLES:
|
|
||||||
NUMFRAMES - The number of times the draw3dscreen function was called
|
|
||||||
since the engine was initialized. This helps to determine frame
|
|
||||||
rate. (Frame rate = numframes * 120 / I_GetBuildTime().)
|
|
||||||
|
|
||||||
OTHER VARIABLES:
|
OTHER VARIABLES:
|
||||||
|
|
||||||
STARTUMOST[320] is an array of the highest y-coordinates on each column
|
|
||||||
that my engine is allowed to write to. You need to set it only
|
|
||||||
once.
|
|
||||||
STARTDMOST[320] is an array of the lowest y-coordinates on each column
|
|
||||||
that my engine is allowed to write to. You need to set it only
|
|
||||||
once.
|
|
||||||
SINTABLE[2048] is a sin table with 2048 angles rather than the
|
SINTABLE[2048] is a sin table with 2048 angles rather than the
|
||||||
normal 360 angles for higher precision. Also since SINTABLE is in
|
normal 360 angles for higher precision. Also since SINTABLE is in
|
||||||
all integers, the range is multiplied by 16383, so instead of the
|
all integers, the range is multiplied by 16383, so instead of the
|
||||||
|
@ -454,7 +431,6 @@ int findwallbetweensectors(int sect1, int sect2);
|
||||||
inline int sectoradjacent(int sect1, int sect2) { return findwallbetweensectors(sect1, sect2) != -1; }
|
inline int sectoradjacent(int sect1, int sect2) { return findwallbetweensectors(sect1, sect2) != -1; }
|
||||||
int32_t getsectordist(vec2_t const in, int const sectnum, vec2_t * const out = nullptr);
|
int32_t getsectordist(vec2_t const in, int const sectnum, vec2_t * const out = nullptr);
|
||||||
extern const int16_t *chsecptr_onextwall;
|
extern const int16_t *chsecptr_onextwall;
|
||||||
int32_t checksectorpointer(int16_t i, int16_t sectnum);
|
|
||||||
|
|
||||||
#if !KRANDDEBUG
|
#if !KRANDDEBUG
|
||||||
inline int32_t krand(void)
|
inline int32_t krand(void)
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#ifndef ENGINE_PRIV_H
|
#ifndef ENGINE_PRIV_H
|
||||||
#define ENGINE_PRIV_H
|
#define ENGINE_PRIV_H
|
||||||
|
|
||||||
|
extern int32_t globalpal, globalfloorpal;
|
||||||
extern tspriteptr_t tspriteptr[MAXSPRITESONSCREEN + 1];
|
extern tspriteptr_t tspriteptr[MAXSPRITESONSCREEN + 1];
|
||||||
extern int32_t xdimen, xdimenscale, xdimscale, ydimen;
|
extern int32_t xdimen, xdimenscale, xdimscale, ydimen;
|
||||||
extern float fxdimen;
|
extern float fxdimen;
|
||||||
|
|
|
@ -73,6 +73,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#include "automap.h"
|
#include "automap.h"
|
||||||
#include "v_draw.h"
|
#include "v_draw.h"
|
||||||
#include "gi.h"
|
#include "gi.h"
|
||||||
|
#include "gamefuncs.h"
|
||||||
|
|
||||||
CVAR(Bool, autoloadlights, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
CVAR(Bool, autoloadlights, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||||
CVAR(Bool, autoloadbrightmaps, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
CVAR(Bool, autoloadbrightmaps, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
||||||
|
|
|
@ -98,4 +98,14 @@ inline int sectorofwall(int wallNum)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern int numshades;
|
||||||
|
|
||||||
|
// Return type is int because this gets passed to variadic functions where structs may produce undefined behavior.
|
||||||
|
inline int shadeToLight(int shade)
|
||||||
|
{
|
||||||
|
shade = clamp(shade, 0, numshades - 1);
|
||||||
|
int light = Scale(numshades - 1 - shade, 255, numshades - 1);
|
||||||
|
return PalEntry(255, light, light, light);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
#include "../../glbackend/glbackend.h"
|
#include "../../glbackend/glbackend.h"
|
||||||
|
|
||||||
LookupTableInfo lookups;
|
LookupTableInfo lookups;
|
||||||
|
int numshades;
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
|
@ -136,7 +137,6 @@ void paletteLoadFromDisk(void)
|
||||||
|
|
||||||
void LookupTableInfo::postLoadTables(void)
|
void LookupTableInfo::postLoadTables(void)
|
||||||
{
|
{
|
||||||
globalpal = 0;
|
|
||||||
GPalette.GenerateGlobalBrightmapFromColormap(getTable(0), numshades);
|
GPalette.GenerateGlobalBrightmapFromColormap(getTable(0), numshades);
|
||||||
|
|
||||||
// Try to detect fullbright translations. Unfortunately this cannot be used to detect fade strength because of loss of color precision in the palette map.
|
// Try to detect fullbright translations. Unfortunately this cannot be used to detect fade strength because of loss of color precision in the palette map.
|
||||||
|
|
|
@ -165,7 +165,7 @@ inline void videoclearFade()
|
||||||
|
|
||||||
void videoTintBlood(int32_t r, int32_t g, int32_t b);
|
void videoTintBlood(int32_t r, int32_t g, int32_t b);
|
||||||
|
|
||||||
extern int32_t globalpal, globalfloorpal;
|
extern int numshades;
|
||||||
extern void paletteLoadFromDisk(void);
|
extern void paletteLoadFromDisk(void);
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -804,7 +804,12 @@ bool HWSkyboxPortal::AllowSSAO() { return false; } // [MK] sector skyboxes don't
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
bool HWSectorStackPortal::Setup(HWDrawInfo *di, FRenderState &rstate, Clipper *clipper)
|
bool HWSectorStackPortal::Setup(HWDrawInfo *di, FRenderState &rstate, Clipper *clipper)
|
||||||
{
|
{
|
||||||
auto state = mState;
|
// TODO: Handle recursion more intelligently
|
||||||
|
auto& state = mState;
|
||||||
|
if (state->renderdepth > r_mirror_recursions)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
auto portal = origin;
|
auto portal = origin;
|
||||||
auto &vp = di->Viewpoint;
|
auto &vp = di->Viewpoint;
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@ Modifications for JonoF's port by Jonathon Fowler (jf@jonof.id.au)
|
||||||
#include "mapinfo.h"
|
#include "mapinfo.h"
|
||||||
#include "c_dispatch.h"
|
#include "c_dispatch.h"
|
||||||
#include "gamestate.h"
|
#include "gamestate.h"
|
||||||
|
#include "gamefuncs.h"
|
||||||
|
|
||||||
BEGIN_DUKE_NS
|
BEGIN_DUKE_NS
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
|
||||||
#include "texturemanager.h"
|
#include "texturemanager.h"
|
||||||
#include "c_dispatch.h"
|
#include "c_dispatch.h"
|
||||||
#include "gamestate.h"
|
#include "gamestate.h"
|
||||||
|
#include "gamefuncs.h"
|
||||||
|
|
||||||
BEGIN_DUKE_NS
|
BEGIN_DUKE_NS
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#include "v_draw.h"
|
#include "v_draw.h"
|
||||||
#include "m_random.h"
|
#include "m_random.h"
|
||||||
#include "gstrings.h"
|
#include "gstrings.h"
|
||||||
|
#include "gamefuncs.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
|
|
@ -50,6 +50,7 @@
|
||||||
#include "hw_cvars.h"
|
#include "hw_cvars.h"
|
||||||
#include "gamestruct.h"
|
#include "gamestruct.h"
|
||||||
#include "gl_models.h"
|
#include "gl_models.h"
|
||||||
|
#include "gamefuncs.h"
|
||||||
|
|
||||||
CVARD(Bool, hw_hightile, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "enable/disable hightile texture rendering")
|
CVARD(Bool, hw_hightile, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "enable/disable hightile texture rendering")
|
||||||
bool hw_int_useindexedcolortextures;
|
bool hw_int_useindexedcolortextures;
|
||||||
|
|
Loading…
Reference in a new issue