Merge pull request #3176 from lioncash/namespace
Core: Move a global into a namespace
This commit is contained in:
commit
dc096d2fe5
|
@ -74,12 +74,12 @@
|
||||||
#define ThreadLocalStorage __thread
|
#define ThreadLocalStorage __thread
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// TODO: ugly, remove
|
|
||||||
bool g_aspect_wide;
|
|
||||||
|
|
||||||
namespace Core
|
namespace Core
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// TODO: ugly, remove
|
||||||
|
bool g_aspect_wide;
|
||||||
|
|
||||||
bool g_want_determinism;
|
bool g_want_determinism;
|
||||||
|
|
||||||
// Declarations and definitions
|
// Declarations and definitions
|
||||||
|
|
|
@ -16,12 +16,12 @@
|
||||||
|
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
|
|
||||||
// TODO: ugly, remove
|
|
||||||
extern bool g_aspect_wide;
|
|
||||||
|
|
||||||
namespace Core
|
namespace Core
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// TODO: ugly, remove
|
||||||
|
extern bool g_aspect_wide;
|
||||||
|
|
||||||
extern bool g_want_determinism;
|
extern bool g_want_determinism;
|
||||||
|
|
||||||
bool GetIsFramelimiterTempDisabled();
|
bool GetIsFramelimiterTempDisabled();
|
||||||
|
|
|
@ -431,7 +431,7 @@ void Renderer::UpdateDrawRectangle(int backbuffer_width, int backbuffer_height)
|
||||||
// Don't know if there is a better place for this code so there isn't a 1 frame delay
|
// Don't know if there is a better place for this code so there isn't a 1 frame delay
|
||||||
if (g_ActiveConfig.bWidescreenHack)
|
if (g_ActiveConfig.bWidescreenHack)
|
||||||
{
|
{
|
||||||
float source_aspect = VideoInterface::GetAspectRatio(g_aspect_wide);
|
float source_aspect = VideoInterface::GetAspectRatio(Core::g_aspect_wide);
|
||||||
float target_aspect;
|
float target_aspect;
|
||||||
|
|
||||||
switch (g_ActiveConfig.iAspectRatio)
|
switch (g_ActiveConfig.iAspectRatio)
|
||||||
|
@ -485,7 +485,7 @@ void Renderer::UpdateDrawRectangle(int backbuffer_width, int backbuffer_height)
|
||||||
Ratio = (WinWidth / WinHeight) / VideoInterface::GetAspectRatio(false);
|
Ratio = (WinWidth / WinHeight) / VideoInterface::GetAspectRatio(false);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Ratio = (WinWidth / WinHeight) / VideoInterface::GetAspectRatio(g_aspect_wide);
|
Ratio = (WinWidth / WinHeight) / VideoInterface::GetAspectRatio(Core::g_aspect_wide);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -521,7 +521,7 @@ void Renderer::UpdateDrawRectangle(int backbuffer_width, int backbuffer_height)
|
||||||
Ratio = (4.0f / 3.0f) / VideoInterface::GetAspectRatio(false);
|
Ratio = (4.0f / 3.0f) / VideoInterface::GetAspectRatio(false);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Ratio = (!g_aspect_wide ? (4.0f / 3.0f) : (16.0f / 9.0f)) / VideoInterface::GetAspectRatio(g_aspect_wide);
|
Ratio = (!Core::g_aspect_wide ? (4.0f / 3.0f) : (16.0f / 9.0f)) / VideoInterface::GetAspectRatio(Core::g_aspect_wide);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (Ratio <= 1.0f)
|
if (Ratio <= 1.0f)
|
||||||
|
|
|
@ -443,9 +443,9 @@ void VertexShaderManager::SetConstants()
|
||||||
{
|
{
|
||||||
bool viewport_is_4_3 = AspectIs4_3(xfmem.viewport.wd, xfmem.viewport.ht);
|
bool viewport_is_4_3 = AspectIs4_3(xfmem.viewport.wd, xfmem.viewport.ht);
|
||||||
if (AspectIs16_9(rawProjection[2], rawProjection[0]) && viewport_is_4_3)
|
if (AspectIs16_9(rawProjection[2], rawProjection[0]) && viewport_is_4_3)
|
||||||
g_aspect_wide = true; // Projection is 16:9 and viewport is 4:3, we are rendering an anamorphic widescreen picture
|
Core::g_aspect_wide = true; // Projection is 16:9 and viewport is 4:3, we are rendering an anamorphic widescreen picture
|
||||||
else if (AspectIs4_3(rawProjection[2], rawProjection[0]) && viewport_is_4_3)
|
else if (AspectIs4_3(rawProjection[2], rawProjection[0]) && viewport_is_4_3)
|
||||||
g_aspect_wide = false; // Project and viewports are both 4:3, we are rendering a normal image.
|
Core::g_aspect_wide = false; // Project and viewports are both 4:3, we are rendering a normal image.
|
||||||
}
|
}
|
||||||
|
|
||||||
SETSTAT_FT(stats.gproj_0, g_fProjectionMatrix[0]);
|
SETSTAT_FT(stats.gproj_0, g_fProjectionMatrix[0]);
|
||||||
|
|
Loading…
Reference in New Issue