mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
VideoCommon: Move some common initialization logic to RenderBase
This commit is contained in:
@ -50,6 +50,7 @@
|
||||
#include "VideoCommon/FramebufferManagerBase.h"
|
||||
#include "VideoCommon/ImageWrite.h"
|
||||
#include "VideoCommon/OnScreenDisplay.h"
|
||||
#include "VideoCommon/PixelShaderManager.h"
|
||||
#include "VideoCommon/PostProcessing.h"
|
||||
#include "VideoCommon/Statistics.h"
|
||||
#include "VideoCommon/TextureCacheBase.h"
|
||||
@ -75,10 +76,19 @@ static float AspectToWidescreen(float aspect)
|
||||
return aspect * ((16.0f / 9.0f) / (4.0f / 3.0f));
|
||||
}
|
||||
|
||||
Renderer::Renderer()
|
||||
Renderer::Renderer(int backbuffer_width, int backbuffer_height)
|
||||
{
|
||||
FramebufferManagerBase::SetLastXfbWidth(MAX_XFB_WIDTH);
|
||||
FramebufferManagerBase::SetLastXfbHeight(MAX_XFB_HEIGHT);
|
||||
|
||||
UpdateActiveConfig();
|
||||
|
||||
s_backbuffer_width = backbuffer_width;
|
||||
s_backbuffer_height = backbuffer_height;
|
||||
s_last_efb_scale = g_ActiveConfig.iEFBScale;
|
||||
CalculateTargetSize();
|
||||
UpdateDrawRectangle();
|
||||
|
||||
OSDChoice = 0;
|
||||
OSDTime = 0;
|
||||
}
|
||||
@ -606,6 +616,11 @@ void Renderer::UpdateDrawRectangle()
|
||||
target_rc.bottom = YOffset + iHeight;
|
||||
}
|
||||
|
||||
void Renderer::InitializeCommon()
|
||||
{
|
||||
PixelShaderManager::SetEfbScaleChanged();
|
||||
}
|
||||
|
||||
void Renderer::SetWindowSize(int width, int height)
|
||||
{
|
||||
if (width < 1)
|
||||
|
@ -50,7 +50,7 @@ extern int OSDChoice;
|
||||
class Renderer
|
||||
{
|
||||
public:
|
||||
Renderer();
|
||||
Renderer(int backbuffer_width, int backbuffer_height);
|
||||
virtual ~Renderer();
|
||||
|
||||
enum PixelPerfQuery
|
||||
@ -79,6 +79,10 @@ public:
|
||||
virtual void RestoreState() {}
|
||||
virtual void ResetAPIState() {}
|
||||
virtual void RestoreAPIState() {}
|
||||
// Some of the methods called by here assume g_renderer is initialized, therefore
|
||||
// we must call it after constructing the backend's Renderer instance.
|
||||
void InitializeCommon();
|
||||
|
||||
// Ideal internal resolution - determined by display resolution (automatic scaling) and/or a
|
||||
// multiple of the native EFB resolution
|
||||
int GetTargetWidth() { return s_target_width; }
|
||||
|
Reference in New Issue
Block a user