mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 14:51:40 +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 viewwindowy;
|
||||
extern "C" int viewheight;
|
||||
extern "C" int viewwidth;
|
||||
extern int viewheight;
|
||||
extern int viewwidth;
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -57,10 +57,8 @@
|
|||
static bool R_CheckForFixedLights(const uint8_t *colormaps);
|
||||
|
||||
|
||||
extern "C" {
|
||||
FDynamicColormap NormalLight;
|
||||
FDynamicColormap FullNormalLight; //[SP] Emulate GZDoom brightness
|
||||
}
|
||||
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 "C"
|
||||
{
|
||||
extern FDynamicColormap NormalLight;
|
||||
extern FDynamicColormap FullNormalLight;
|
||||
}
|
||||
extern bool NormalLightHasFixedLights;
|
||||
|
||||
FDynamicColormap *GetSpecialLights (PalEntry lightcolor, PalEntry fadecolor, int desaturate);
|
||||
|
|
|
@ -33,8 +33,10 @@
|
|||
// for rendering.
|
||||
//
|
||||
|
||||
extern "C" int viewwidth;
|
||||
extern "C" int viewheight;
|
||||
extern int viewwindowx;
|
||||
extern int viewwindowy;
|
||||
extern int viewwidth;
|
||||
extern int viewheight;
|
||||
|
||||
//
|
||||
// Lookup tables for map data.
|
||||
|
@ -65,10 +67,6 @@ extern int numgamesubsectors;
|
|||
//
|
||||
// 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
|
||||
|
||||
|
|
|
@ -103,6 +103,8 @@ CUSTOM_CVAR(Float, r_quakeintensity, 1.0f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
|||
|
||||
int viewwindowx;
|
||||
int viewwindowy;
|
||||
int viewwidth;
|
||||
int viewheight;
|
||||
|
||||
DVector3 ViewPos;
|
||||
DVector3 ViewActorPos; // the actual position of the viewing actor, without interpolation and quake offsets.
|
||||
|
@ -110,22 +112,18 @@ DAngle ViewAngle;
|
|||
DAngle ViewPitch;
|
||||
DAngle ViewRoll;
|
||||
DVector3 ViewPath[2];
|
||||
double ViewCos, ViewTanCos;
|
||||
double ViewSin, ViewTanSin;
|
||||
|
||||
|
||||
extern "C"
|
||||
{
|
||||
int viewwidth;
|
||||
int viewheight;
|
||||
int centerx;
|
||||
int centery;
|
||||
int centerxwide;
|
||||
}
|
||||
|
||||
int otic;
|
||||
|
||||
sector_t *viewsector;
|
||||
|
||||
double ViewCos, ViewTanCos;
|
||||
double ViewSin, ViewTanSin;
|
||||
|
||||
AActor *camera; // [RH] camera to draw from. doesn't have to be a player
|
||||
|
||||
|
|
|
@ -12,43 +12,77 @@ class FSerializer;
|
|||
// There a 0-31, i.e. 32 LUT in the COLORMAP lump.
|
||||
#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 ViewActorPos;
|
||||
extern DAngle ViewAngle;
|
||||
extern DAngle ViewPitch;
|
||||
extern DAngle ViewRoll;
|
||||
extern DVector3 ViewPath[2];
|
||||
|
||||
extern double ViewCos;
|
||||
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 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 int validcount;
|
||||
|
||||
extern angle_t LocalViewAngle; // [RH] Added to consoleplayer's angle
|
||||
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 float WidescreenRatio;
|
||||
|
||||
extern double r_TicFracF;
|
||||
extern uint32_t r_FrameTime;
|
||||
extern int extralight;
|
||||
extern unsigned int R_OldBlend;
|
||||
|
||||
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_pfx.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
PfxUnion GPfxPal;
|
||||
PfxState GPfx;
|
||||
}
|
||||
|
||||
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);
|
||||
};
|
||||
|
||||
extern "C"
|
||||
{
|
||||
extern PfxUnion GPfxPal;
|
||||
extern PfxState GPfx;
|
||||
}
|
||||
|
||||
#endif //__V_PFX_H__
|
||||
|
|
|
@ -142,13 +142,11 @@ int DisplayWidth, DisplayHeight, DisplayBits;
|
|||
|
||||
FFont *SmallFont, *SmallFont2, *BigFont, *ConFont, *IntermissionFont;
|
||||
|
||||
extern "C" {
|
||||
uint32_t Col2RGB8[65][256];
|
||||
uint32_t *Col2RGB8_LessPrecision[65];
|
||||
uint32_t Col2RGB8_Inverse[65][256];
|
||||
ColorTable32k RGB32k;
|
||||
ColorTable256k RGB256k;
|
||||
}
|
||||
|
||||
|
||||
static uint32_t Col2RGB8_2[63][256];
|
||||
|
|
|
@ -475,7 +475,7 @@ union ColorTable32k
|
|||
uint8_t RGB[32][32][32];
|
||||
uint8_t All[32 *32 *32];
|
||||
};
|
||||
extern "C" ColorTable32k RGB32k;
|
||||
extern ColorTable32k RGB32k;
|
||||
|
||||
// [SP] RGB666 support
|
||||
union ColorTable256k
|
||||
|
@ -483,24 +483,24 @@ union ColorTable256k
|
|||
uint8_t RGB[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
|
||||
// special R10B10G10 format for efficient blending computation.
|
||||
// --RRRRRrrr--BBBBBbbb--GGGGGggg-- at level 64
|
||||
// --------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
|
||||
// and blue are forced to zero, so if the blend overflows, it won't spill
|
||||
// over into the next component's value.
|
||||
// --RRRRRrrr-#BBBBBbbb-#GGGGGggg-- at level 64
|
||||
// --------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
|
||||
// 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:
|
||||
// --000001111100000111110000011111 = 0x01f07c1f
|
||||
|
|
|
@ -2,10 +2,7 @@
|
|||
#include "doomdef.h"
|
||||
#include "x86.h"
|
||||
|
||||
extern "C"
|
||||
{
|
||||
CPUInfo CPU;
|
||||
}
|
||||
|
||||
#if !defined(__amd64__) && !defined(__i386__) && !defined(_M_IX86) && !defined(_M_X64)
|
||||
void CheckCPUID(CPUInfo *cpu)
|
||||
|
|
|
@ -100,7 +100,7 @@ struct CPUInfo // 92 bytes
|
|||
};
|
||||
|
||||
|
||||
extern "C" CPUInfo CPU;
|
||||
extern CPUInfo CPU;
|
||||
struct PalEntry;
|
||||
|
||||
void CheckCPUID (CPUInfo *cpu);
|
||||
|
|
Loading…
Reference in a new issue