mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-25 13:41:05 +00:00
- took GetMaxViewPitch out of renderer interfaces.
With live switching and both renderers on the same backend the old approach will no longer work.
This commit is contained in:
parent
9a919960c9
commit
51bf2eb9fa
6 changed files with 29 additions and 40 deletions
|
@ -1005,7 +1005,6 @@ struct FGLInterface : public FRenderer
|
|||
void RenderTextureView (FCanvasTexture *self, AActor *viewpoint, double fov) override;
|
||||
void PreprocessLevel() override;
|
||||
|
||||
int GetMaxViewPitch(bool down) override;
|
||||
void SetClearColor(int color) override;
|
||||
uint32_t GetCaps() override;
|
||||
};
|
||||
|
@ -1022,19 +1021,6 @@ void FGLInterface::Precache(uint8_t *texhitlist, TMap<PClassActor*, bool> &actor
|
|||
gl_PrecacheTexture(texhitlist, actorhitlist);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// Get max. view angle (renderer specific information so it goes here now)
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
EXTERN_CVAR(Float, maxviewpitch)
|
||||
|
||||
int FGLInterface::GetMaxViewPitch(bool down)
|
||||
{
|
||||
return int(maxviewpitch);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
//
|
||||
|
|
|
@ -730,13 +730,38 @@ bool player_t::GetPainFlash(FName type, PalEntry *color) const
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
EXTERN_CVAR(Float, maxviewpitch)
|
||||
EXTERN_CVAR(Bool, r_polyrenderer)
|
||||
EXTERN_CVAR(Bool, cl_oldfreelooklimit);
|
||||
extern int currentrenderer;
|
||||
|
||||
|
||||
static int GetSoftPitch(bool down)
|
||||
{
|
||||
int MAX_DN_ANGLE = MIN(56, (int)maxviewpitch); // Max looking down angle
|
||||
int MAX_UP_ANGLE = MIN(32, (int)maxviewpitch); // Max looking up angle
|
||||
return (down ? MAX_DN_ANGLE : ((cl_oldfreelooklimit) ? MAX_UP_ANGLE : MAX_DN_ANGLE));
|
||||
}
|
||||
|
||||
void player_t::SendPitchLimits() const
|
||||
{
|
||||
if (this - players == consoleplayer)
|
||||
{
|
||||
int uppitch, downpitch;
|
||||
|
||||
if (currentrenderer == 0 && !r_polyrenderer)
|
||||
{
|
||||
uppitch = GetSoftPitch(false);
|
||||
downpitch = GetSoftPitch(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
uppitch = downpitch = (int)maxviewpitch;
|
||||
}
|
||||
|
||||
Net_WriteByte(DEM_SETPITCHLIMIT);
|
||||
Net_WriteByte(Renderer->GetMaxViewPitch(false)); // up
|
||||
Net_WriteByte(Renderer->GetMaxViewPitch(true)); // down
|
||||
Net_WriteByte(uppitch);
|
||||
Net_WriteByte(downpitch);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -37,8 +37,6 @@ struct FRenderer
|
|||
// draws player sprites with hardware acceleration (only useful for software rendering)
|
||||
virtual void DrawRemainingPlayerSprites() {}
|
||||
|
||||
virtual int GetMaxViewPitch(bool down) = 0; // return value is in plain degrees
|
||||
|
||||
virtual void OnModeSet () {}
|
||||
virtual void SetClearColor(int color) = 0;
|
||||
virtual void RenderTextureView (FCanvasTexture *tex, AActor *viewpoint, double fov) = 0;
|
||||
|
|
|
@ -235,13 +235,6 @@ void FSoftwareRenderer::DrawRemainingPlayerSprites()
|
|||
}
|
||||
}
|
||||
|
||||
int FSoftwareRenderer::GetMaxViewPitch(bool down)
|
||||
{
|
||||
int MAX_DN_ANGLE = MIN(56, (int)maxviewpitch); // Max looking down angle
|
||||
int MAX_UP_ANGLE = MIN(32, (int)maxviewpitch); // Max looking up angle
|
||||
return (r_polyrenderer) ? int(maxviewpitch) : (down ? MAX_DN_ANGLE : ((cl_oldfreelooklimit) ? MAX_UP_ANGLE : MAX_DN_ANGLE));
|
||||
}
|
||||
|
||||
void FSoftwareRenderer::OnModeSet ()
|
||||
{
|
||||
mScene.ScreenResized();
|
||||
|
|
|
@ -21,8 +21,6 @@ struct FSoftwareRenderer : public FRenderer
|
|||
// draws player sprites with hardware acceleration (only useful for software rendering)
|
||||
void DrawRemainingPlayerSprites() override;
|
||||
|
||||
int GetMaxViewPitch(bool down) override;
|
||||
|
||||
void OnModeSet() override;
|
||||
void SetClearColor(int color) override;
|
||||
void RenderTextureView (FCanvasTexture *tex, AActor *viewpoint, double fov) override;
|
||||
|
|
|
@ -98,13 +98,6 @@ CUSTOM_CVAR(Int, vid_gpuswitch, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINI
|
|||
}
|
||||
}
|
||||
|
||||
// Software OpenGL canvas
|
||||
CUSTOM_CVAR(Bool, vid_glswfb, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
|
||||
{
|
||||
if ((self ? 1 : 0) != currentcanvas)
|
||||
Printf("You must restart " GAMENAME " for this change to take effect.\n");
|
||||
}
|
||||
|
||||
// [ZDoomGL]
|
||||
CUSTOM_CVAR (Int, vid_renderer, 1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
|
||||
{
|
||||
|
@ -195,15 +188,11 @@ static void I_DeleteRenderer()
|
|||
void I_CreateRenderer()
|
||||
{
|
||||
currentrenderer = vid_renderer;
|
||||
currentcanvas = vid_glswfb;
|
||||
if (currentrenderer == 1)
|
||||
Printf("Renderer: OpenGL\n");
|
||||
else if (currentcanvas == 1)
|
||||
Printf("Renderer: Software on OpenGL\n");
|
||||
else if (currentcanvas == 0)
|
||||
Printf("Renderer: Software on Direct3D\n");
|
||||
else
|
||||
Printf("Renderer: Unknown\n");
|
||||
Printf("Renderer: Software on OpenGL\n");
|
||||
|
||||
if (Renderer == NULL)
|
||||
{
|
||||
if (currentrenderer==1) Renderer = gl_CreateInterface();
|
||||
|
|
Loading…
Reference in a new issue