2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 23:07:42 +00:00

Aux-info resource sharing; some rigging stubs

This commit is contained in:
Jack Andersen
2016-04-04 15:51:25 -10:00
parent 806cd54b75
commit 5cd372592c
27 changed files with 287 additions and 36 deletions

View File

@@ -365,6 +365,31 @@ void CGraphics::SetViewportResolution(const zeus::CVector2i& res)
g_ViewportResolutionHalf = {res.x / 2, res.y / 2};
}
static boo::SWindowRect CachedVP;
static float CachedDepthRange[2] = {0.f, 1.f};
void CGraphics::SetViewport(int leftOff, int bottomOff, int width, int height)
{
CachedVP.location[0] = leftOff;
CachedVP.location[1] = bottomOff;
CachedVP.size[0] = width;
CachedVP.size[1] = height;
g_BooMainCommandQueue->setViewport(CachedVP, CachedDepthRange[0], CachedDepthRange[1]);
}
void CGraphics::SetScissor(int leftOff, int bottomOff, int width, int height)
{
boo::SWindowRect rect(leftOff, bottomOff, width, height);
g_BooMainCommandQueue->setScissor(rect);
}
void CGraphics::SetDepthRange(float znear, float zfar)
{
CachedDepthRange[0] = znear;
CachedDepthRange[1] = zfar;
g_BooMainCommandQueue->setViewport(CachedVP, CachedDepthRange[0], CachedDepthRange[1]);
}
CTimeProvider* CGraphics::g_ExternalTimeProvider = nullptr;
float CGraphics::g_DefaultSeconds;