rename UpdateViewport to SetViewport like all others setters in RenderBase.h

This commit is contained in:
degasus 2014-02-04 10:45:38 +01:00
parent 3cd6918dec
commit 5a660c27bc
7 changed files with 14 additions and 19 deletions

View File

@ -476,8 +476,7 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data)
}
// Called from VertexShaderManager
void Renderer::UpdateViewport()
void Renderer::SetViewport()
{
// reversed gxsetviewport(xorig, yorig, width, height, nearz, farz)
// [0] = width/2
@ -1018,7 +1017,7 @@ void Renderer::Swap(u32 xfbAddr, u32 fbWidth, u32 fbHeight,const EFBRectangle& r
RestoreAPIState();
D3D::BeginFrame();
D3D::context->OMSetRenderTargets(1, &FramebufferManager::GetEFBColorTexture()->GetRTV(), FramebufferManager::GetEFBDepthTexture()->GetDSV());
UpdateViewport();
SetViewport();
Core::Callback_VideoCopiedToXFB(XFBWrited || (g_ActiveConfig.bUseXFB && g_ActiveConfig.bUseRealXFB));
XFBWrited = false;
@ -1038,7 +1037,7 @@ void Renderer::RestoreAPIState()
D3D::stateman->PopBlendState();
D3D::stateman->PopDepthState();
D3D::stateman->PopRasterizerState();
UpdateViewport();
SetViewport();
BPFunctions::SetScissor();
}

View File

@ -21,6 +21,7 @@ public:
void SetLineWidth();
void SetSamplerState(int stage,int texindex);
void SetInterlacingMode();
void SetViewport();
// TODO: Fix confusing names (see ResetAPIState and RestoreAPIState)
void ApplyState(bool bUseDstAlpha);
@ -44,8 +45,6 @@ public:
void ReinterpretPixelData(unsigned int convtype);
void UpdateViewport();
bool SaveScreenshot(const std::string &filename, const TargetRectangle &rc);
static bool CheckForResize();

View File

@ -1078,8 +1078,7 @@ u32 Renderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data)
return 0;
}
// Called from VertexShaderManager
void Renderer::UpdateViewport()
void Renderer::SetViewport()
{
// reversed gxsetviewport(xorig, yorig, width, height, nearz, farz)
// [0] = width/2
@ -1651,7 +1650,7 @@ void Renderer::RestoreAPIState()
SetDepthMode();
SetBlendMode(true);
SetLogicOpMode();
UpdateViewport();
SetViewport();
if (GLInterface->GetMode() == GLInterfaceMode::MODE_OPENGL)
glPolygonMode(GL_FRONT_AND_BACK, g_ActiveConfig.bWireFrame ? GL_LINE : GL_FILL);

View File

@ -54,6 +54,7 @@ public:
void SetLineWidth() override;
void SetSamplerState(int stage,int texindex) override;
void SetInterlacingMode() override;
void SetViewport() override;
// TODO: Implement and use these
void ApplyState(bool bUseDstAlpha) override {}
@ -76,8 +77,6 @@ public:
void ReinterpretPixelData(unsigned int convtype) override;
void UpdateViewport() override;
bool SaveScreenshot(const std::string &filename, const TargetRectangle &rc);
private:

View File

@ -509,8 +509,8 @@ void Renderer::RecordVideoMemory()
FifoRecorder::GetInstance().SetVideoMemory(bpMem, cpMem, xfMem, xfRegs, sizeof(XFRegisters) / 4);
}
void UpdateViewport()
void SetViewport()
{
if (xfregs.viewport.wd != 0 && xfregs.viewport.ht != 0)
g_renderer->UpdateViewport();
g_renderer->SetViewport();
}

View File

@ -57,6 +57,7 @@ public:
virtual void SetLineWidth() = 0;
virtual void SetSamplerState(int stage,int texindex) = 0;
virtual void SetInterlacingMode() = 0;
virtual void SetViewport() = 0;
virtual void ApplyState(bool bUseDstAlpha) = 0;
virtual void RestoreState() = 0;
@ -107,8 +108,6 @@ public:
// Finish up the current frame, print some stats
virtual void Swap(u32 xfbAddr, u32 fbWidth, u32 fbHeight, const EFBRectangle& rc,float Gamma = 1.0f) = 0;
virtual void UpdateViewport() = 0;
virtual bool SaveScreenshot(const std::string &filename, const TargetRectangle &rc) = 0;
static unsigned int GetPrevPixelFormat() { return prev_efb_format; }
@ -160,4 +159,5 @@ private:
extern Renderer *g_renderer;
void UpdateViewport();
extern void SetViewport();

View File

@ -18,6 +18,7 @@
#include "XFMemory.h"
#include "VideoCommon.h"
#include "VertexManagerBase.h"
#include "RenderBase.h"
#include "RenderBase.h"
float GC_ALIGNED16(g_fProjectionMatrix[16]);
@ -173,8 +174,6 @@ static void ViewportCorrectionMatrix(Matrix44& result)
result.data[4*1+3] = (-intendedHt + 2.f * (Y - intendedY)) / Ht + 1.f;
}
void UpdateViewport();
void VertexShaderManager::Init()
{
Dirty();
@ -373,7 +372,7 @@ void VertexShaderManager::SetConstants()
constants.depthparams[1] = xfregs.viewport.zRange / 16777216.0f;
dirty = true;
// This is so implementation-dependent that we can't have it here.
UpdateViewport();
SetViewport();
// Update projection if the viewport isn't 1:1 useable
if(!g_ActiveConfig.backend_info.bSupportsOversizedViewports)