mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +00:00
- removed many 'extern "C"' declarations, now that assembly is no longer a concern.
- some concepts about building a RenderViewpoint struct. No actual work yet.
This commit is contained in:
parent
56986ba843
commit
72da1fed7e
12 changed files with 75 additions and 61 deletions
|
@ -122,8 +122,8 @@ extern bool noblit;
|
||||||
|
|
||||||
extern int viewwindowx;
|
extern int viewwindowx;
|
||||||
extern int viewwindowy;
|
extern int viewwindowy;
|
||||||
extern "C" int viewheight;
|
extern int viewheight;
|
||||||
extern "C" int viewwidth;
|
extern int viewwidth;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -57,10 +57,8 @@
|
||||||
static bool R_CheckForFixedLights(const uint8_t *colormaps);
|
static bool R_CheckForFixedLights(const uint8_t *colormaps);
|
||||||
|
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
FDynamicColormap NormalLight;
|
FDynamicColormap NormalLight;
|
||||||
FDynamicColormap FullNormalLight; //[SP] Emulate GZDoom brightness
|
FDynamicColormap FullNormalLight; //[SP] Emulate GZDoom brightness
|
||||||
}
|
|
||||||
bool NormalLightHasFixedLights;
|
bool NormalLightHasFixedLights;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -77,11 +77,8 @@ int AddSpecialColormap(float r1, float g1, float b1, float r2, float g2, float b
|
||||||
|
|
||||||
|
|
||||||
extern uint8_t DesaturateColormap[31][256];
|
extern uint8_t DesaturateColormap[31][256];
|
||||||
extern "C"
|
|
||||||
{
|
|
||||||
extern FDynamicColormap NormalLight;
|
extern FDynamicColormap NormalLight;
|
||||||
extern FDynamicColormap FullNormalLight;
|
extern FDynamicColormap FullNormalLight;
|
||||||
}
|
|
||||||
extern bool NormalLightHasFixedLights;
|
extern bool NormalLightHasFixedLights;
|
||||||
|
|
||||||
FDynamicColormap *GetSpecialLights (PalEntry lightcolor, PalEntry fadecolor, int desaturate);
|
FDynamicColormap *GetSpecialLights (PalEntry lightcolor, PalEntry fadecolor, int desaturate);
|
||||||
|
|
|
@ -33,8 +33,10 @@
|
||||||
// for rendering.
|
// for rendering.
|
||||||
//
|
//
|
||||||
|
|
||||||
extern "C" int viewwidth;
|
extern int viewwindowx;
|
||||||
extern "C" int viewheight;
|
extern int viewwindowy;
|
||||||
|
extern int viewwidth;
|
||||||
|
extern int viewheight;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Lookup tables for map data.
|
// Lookup tables for map data.
|
||||||
|
@ -65,10 +67,6 @@ extern int numgamesubsectors;
|
||||||
//
|
//
|
||||||
// POV data.
|
// POV data.
|
||||||
//
|
//
|
||||||
extern AActor* camera; // [RH] camera instead of viewplayer
|
|
||||||
extern sector_t* viewsector; // [RH] keep track of sector viewing from
|
|
||||||
|
|
||||||
extern DAngle FieldOfView;
|
|
||||||
|
|
||||||
int R_FindSkin (const char *name, int pclass); // [RH] Find a skin
|
int R_FindSkin (const char *name, int pclass); // [RH] Find a skin
|
||||||
|
|
||||||
|
|
|
@ -103,6 +103,8 @@ CUSTOM_CVAR(Float, r_quakeintensity, 1.0f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
||||||
|
|
||||||
int viewwindowx;
|
int viewwindowx;
|
||||||
int viewwindowy;
|
int viewwindowy;
|
||||||
|
int viewwidth;
|
||||||
|
int viewheight;
|
||||||
|
|
||||||
DVector3 ViewPos;
|
DVector3 ViewPos;
|
||||||
DVector3 ViewActorPos; // the actual position of the viewing actor, without interpolation and quake offsets.
|
DVector3 ViewActorPos; // the actual position of the viewing actor, without interpolation and quake offsets.
|
||||||
|
@ -110,27 +112,23 @@ DAngle ViewAngle;
|
||||||
DAngle ViewPitch;
|
DAngle ViewPitch;
|
||||||
DAngle ViewRoll;
|
DAngle ViewRoll;
|
||||||
DVector3 ViewPath[2];
|
DVector3 ViewPath[2];
|
||||||
|
double ViewCos, ViewTanCos;
|
||||||
|
double ViewSin, ViewTanSin;
|
||||||
|
|
||||||
extern "C"
|
|
||||||
{
|
int centerx;
|
||||||
int viewwidth;
|
int centery;
|
||||||
int viewheight;
|
int centerxwide;
|
||||||
int centerx;
|
|
||||||
int centery;
|
|
||||||
int centerxwide;
|
|
||||||
}
|
|
||||||
|
|
||||||
int otic;
|
int otic;
|
||||||
|
|
||||||
sector_t *viewsector;
|
sector_t *viewsector;
|
||||||
|
|
||||||
double ViewCos, ViewTanCos;
|
|
||||||
double ViewSin, ViewTanSin;
|
|
||||||
|
|
||||||
AActor *camera; // [RH] camera to draw from. doesn't have to be a player
|
AActor *camera; // [RH] camera to draw from. doesn't have to be a player
|
||||||
|
|
||||||
double r_TicFracF; // same as floating point
|
double r_TicFracF; // same as floating point
|
||||||
uint32_t r_FrameTime; // [RH] Time this frame started drawing (in ms)
|
uint32_t r_FrameTime; // [RH] Time this frame started drawing (in ms)
|
||||||
bool r_NoInterpolate;
|
bool r_NoInterpolate;
|
||||||
bool r_showviewer;
|
bool r_showviewer;
|
||||||
|
|
||||||
|
|
|
@ -12,43 +12,77 @@ class FSerializer;
|
||||||
// There a 0-31, i.e. 32 LUT in the COLORMAP lump.
|
// There a 0-31, i.e. 32 LUT in the COLORMAP lump.
|
||||||
#define NUMCOLORMAPS 32
|
#define NUMCOLORMAPS 32
|
||||||
|
|
||||||
|
struct FRenderViewpoint
|
||||||
|
{
|
||||||
|
player_t *player; // For which player is this viewpoint being renderered? (can be null for camera textures)
|
||||||
|
DVector3 Pos; // Camera position
|
||||||
|
DVector3 ActorPos; // Camera actor's position
|
||||||
|
DRotator Angles; // Camera angles
|
||||||
|
DVector3 Path; // View path for portal calculations
|
||||||
|
double Cos; // cos(Angles.Yaw)
|
||||||
|
double Sin; // sin(Angles.Yaw)
|
||||||
|
double TanCos; // FocalTangent * cos(Angles.Yaw)
|
||||||
|
double TanSin; // FocalTangent * sin(Angles.Yaw)
|
||||||
|
|
||||||
|
AActor *camera; // camera actor
|
||||||
|
sector_t *sector; // [RH] keep track of sector viewing from
|
||||||
|
DAngle FieldOfView; // current field of view
|
||||||
|
|
||||||
|
double TicFrac; // fraction of tic for interpolation
|
||||||
|
uint32_t FrameTime; // current frame's time in tics.
|
||||||
|
|
||||||
|
int extralight; // extralight to be added to this viewpoint
|
||||||
|
bool showviewer; // show the camera actor?
|
||||||
|
};
|
||||||
|
|
||||||
extern DVector3 ViewPos;
|
extern DVector3 ViewPos;
|
||||||
extern DVector3 ViewActorPos;
|
extern DVector3 ViewActorPos;
|
||||||
extern DAngle ViewAngle;
|
extern DAngle ViewAngle;
|
||||||
extern DAngle ViewPitch;
|
extern DAngle ViewPitch;
|
||||||
extern DAngle ViewRoll;
|
extern DAngle ViewRoll;
|
||||||
extern DVector3 ViewPath[2];
|
extern DVector3 ViewPath[2];
|
||||||
|
|
||||||
extern double ViewCos;
|
extern double ViewCos;
|
||||||
extern double ViewSin;
|
extern double ViewSin;
|
||||||
extern int viewwindowx;
|
|
||||||
extern int viewwindowy;
|
|
||||||
|
|
||||||
extern "C" int centerx, centerxwide;
|
|
||||||
extern "C" int centery;
|
|
||||||
|
|
||||||
extern int setblocks;
|
|
||||||
|
|
||||||
extern double ViewTanCos;
|
extern double ViewTanCos;
|
||||||
extern double ViewTanSin;
|
extern double ViewTanSin;
|
||||||
extern double FocalTangent;
|
extern AActor* camera; // [RH] camera instead of viewplayer
|
||||||
|
extern sector_t* viewsector; // [RH] keep track of sector viewing from
|
||||||
|
extern DAngle FieldOfView;
|
||||||
|
extern double r_TicFracF;
|
||||||
|
extern uint32_t r_FrameTime;
|
||||||
|
extern int extralight;
|
||||||
|
extern bool r_showviewer;
|
||||||
|
|
||||||
|
//-----------------------------------
|
||||||
|
struct FViewWindow
|
||||||
|
{
|
||||||
|
double FocalTangent;
|
||||||
|
int centerx;
|
||||||
|
int centerxwide;
|
||||||
|
int centery;
|
||||||
|
float WidescreenRatio;
|
||||||
|
};
|
||||||
|
|
||||||
|
extern int centerx, centerxwide;
|
||||||
|
extern int centery;
|
||||||
|
extern double FocalTangent;
|
||||||
|
extern float WidescreenRatio;
|
||||||
|
|
||||||
|
//-----------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
extern int setblocks;
|
||||||
extern bool r_NoInterpolate;
|
extern bool r_NoInterpolate;
|
||||||
extern int validcount;
|
extern int validcount;
|
||||||
|
|
||||||
extern angle_t LocalViewAngle; // [RH] Added to consoleplayer's angle
|
extern angle_t LocalViewAngle; // [RH] Added to consoleplayer's angle
|
||||||
extern int LocalViewPitch; // [RH] Used directly instead of consoleplayer's pitch
|
extern int LocalViewPitch; // [RH] Used directly instead of consoleplayer's pitch
|
||||||
extern bool LocalKeyboardTurner; // [RH] The local player used the keyboard to turn, so interpolate
|
extern bool LocalKeyboardTurner; // [RH] The local player used the keyboard to turn, so interpolate
|
||||||
extern float WidescreenRatio;
|
|
||||||
|
|
||||||
extern double r_TicFracF;
|
|
||||||
extern uint32_t r_FrameTime;
|
|
||||||
extern int extralight;
|
|
||||||
extern unsigned int R_OldBlend;
|
extern unsigned int R_OldBlend;
|
||||||
|
|
||||||
const double r_Yaspect = 200.0; // Why did I make this a variable? It's never set anywhere.
|
const double r_Yaspect = 200.0; // Why did I make this a variable? It's never set anywhere.
|
||||||
|
|
||||||
extern bool r_showviewer;
|
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
|
|
|
@ -37,11 +37,8 @@
|
||||||
#include "v_palette.h"
|
#include "v_palette.h"
|
||||||
#include "v_pfx.h"
|
#include "v_pfx.h"
|
||||||
|
|
||||||
extern "C"
|
PfxUnion GPfxPal;
|
||||||
{
|
PfxState GPfx;
|
||||||
PfxUnion GPfxPal;
|
|
||||||
PfxState GPfx;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool AnalyzeMask (uint32_t mask, uint8_t *shift);
|
static bool AnalyzeMask (uint32_t mask, uint8_t *shift);
|
||||||
|
|
||||||
|
|
|
@ -77,10 +77,7 @@ struct PfxState
|
||||||
fixed_t xstep, fixed_t ystep, fixed_t xfrac, fixed_t yfrac);
|
fixed_t xstep, fixed_t ystep, fixed_t xfrac, fixed_t yfrac);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern "C"
|
extern PfxUnion GPfxPal;
|
||||||
{
|
extern PfxState GPfx;
|
||||||
extern PfxUnion GPfxPal;
|
|
||||||
extern PfxState GPfx;
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif //__V_PFX_H__
|
#endif //__V_PFX_H__
|
||||||
|
|
|
@ -142,13 +142,11 @@ int DisplayWidth, DisplayHeight, DisplayBits;
|
||||||
|
|
||||||
FFont *SmallFont, *SmallFont2, *BigFont, *ConFont, *IntermissionFont;
|
FFont *SmallFont, *SmallFont2, *BigFont, *ConFont, *IntermissionFont;
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
uint32_t Col2RGB8[65][256];
|
uint32_t Col2RGB8[65][256];
|
||||||
uint32_t *Col2RGB8_LessPrecision[65];
|
uint32_t *Col2RGB8_LessPrecision[65];
|
||||||
uint32_t Col2RGB8_Inverse[65][256];
|
uint32_t Col2RGB8_Inverse[65][256];
|
||||||
ColorTable32k RGB32k;
|
ColorTable32k RGB32k;
|
||||||
ColorTable256k RGB256k;
|
ColorTable256k RGB256k;
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static uint32_t Col2RGB8_2[63][256];
|
static uint32_t Col2RGB8_2[63][256];
|
||||||
|
|
|
@ -475,7 +475,7 @@ union ColorTable32k
|
||||||
uint8_t RGB[32][32][32];
|
uint8_t RGB[32][32][32];
|
||||||
uint8_t All[32 *32 *32];
|
uint8_t All[32 *32 *32];
|
||||||
};
|
};
|
||||||
extern "C" ColorTable32k RGB32k;
|
extern ColorTable32k RGB32k;
|
||||||
|
|
||||||
// [SP] RGB666 support
|
// [SP] RGB666 support
|
||||||
union ColorTable256k
|
union ColorTable256k
|
||||||
|
@ -483,24 +483,24 @@ union ColorTable256k
|
||||||
uint8_t RGB[64][64][64];
|
uint8_t RGB[64][64][64];
|
||||||
uint8_t All[64 *64 *64];
|
uint8_t All[64 *64 *64];
|
||||||
};
|
};
|
||||||
extern "C" ColorTable256k RGB256k;
|
extern ColorTable256k RGB256k;
|
||||||
|
|
||||||
// Col2RGB8 is a pre-multiplied palette for color lookup. It is stored in a
|
// Col2RGB8 is a pre-multiplied palette for color lookup. It is stored in a
|
||||||
// special R10B10G10 format for efficient blending computation.
|
// special R10B10G10 format for efficient blending computation.
|
||||||
// --RRRRRrrr--BBBBBbbb--GGGGGggg-- at level 64
|
// --RRRRRrrr--BBBBBbbb--GGGGGggg-- at level 64
|
||||||
// --------rrrr------bbbb------gggg at level 1
|
// --------rrrr------bbbb------gggg at level 1
|
||||||
extern "C" uint32_t Col2RGB8[65][256];
|
extern uint32_t Col2RGB8[65][256];
|
||||||
|
|
||||||
// Col2RGB8_LessPrecision is the same as Col2RGB8, but the LSB for red
|
// Col2RGB8_LessPrecision is the same as Col2RGB8, but the LSB for red
|
||||||
// and blue are forced to zero, so if the blend overflows, it won't spill
|
// and blue are forced to zero, so if the blend overflows, it won't spill
|
||||||
// over into the next component's value.
|
// over into the next component's value.
|
||||||
// --RRRRRrrr-#BBBBBbbb-#GGGGGggg-- at level 64
|
// --RRRRRrrr-#BBBBBbbb-#GGGGGggg-- at level 64
|
||||||
// --------rrr#------bbb#------gggg at level 1
|
// --------rrr#------bbb#------gggg at level 1
|
||||||
extern "C" uint32_t *Col2RGB8_LessPrecision[65];
|
extern uint32_t *Col2RGB8_LessPrecision[65];
|
||||||
|
|
||||||
// Col2RGB8_Inverse is the same as Col2RGB8_LessPrecision, except the source
|
// Col2RGB8_Inverse is the same as Col2RGB8_LessPrecision, except the source
|
||||||
// palette has been inverted.
|
// palette has been inverted.
|
||||||
extern "C" uint32_t Col2RGB8_Inverse[65][256];
|
extern uint32_t Col2RGB8_Inverse[65][256];
|
||||||
|
|
||||||
// "Magic" numbers used during the blending:
|
// "Magic" numbers used during the blending:
|
||||||
// --000001111100000111110000011111 = 0x01f07c1f
|
// --000001111100000111110000011111 = 0x01f07c1f
|
||||||
|
|
|
@ -2,10 +2,7 @@
|
||||||
#include "doomdef.h"
|
#include "doomdef.h"
|
||||||
#include "x86.h"
|
#include "x86.h"
|
||||||
|
|
||||||
extern "C"
|
CPUInfo CPU;
|
||||||
{
|
|
||||||
CPUInfo CPU;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if !defined(__amd64__) && !defined(__i386__) && !defined(_M_IX86) && !defined(_M_X64)
|
#if !defined(__amd64__) && !defined(__i386__) && !defined(_M_IX86) && !defined(_M_X64)
|
||||||
void CheckCPUID(CPUInfo *cpu)
|
void CheckCPUID(CPUInfo *cpu)
|
||||||
|
|
|
@ -100,7 +100,7 @@ struct CPUInfo // 92 bytes
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
extern "C" CPUInfo CPU;
|
extern CPUInfo CPU;
|
||||||
struct PalEntry;
|
struct PalEntry;
|
||||||
|
|
||||||
void CheckCPUID (CPUInfo *cpu);
|
void CheckCPUID (CPUInfo *cpu);
|
||||||
|
|
Loading…
Reference in a new issue