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

More CModel imps

This commit is contained in:
Jack Andersen
2016-03-30 20:18:56 -10:00
parent 27bcf57447
commit 7b865683e7
10 changed files with 247 additions and 60 deletions

View File

@@ -1,6 +1,7 @@
#include "Graphics/CGraphics.hpp"
#include "Graphics/CLight.hpp"
#include "zeus/Math.hpp"
#include "CTimeProvider.hpp"
#undef near
#undef far
@@ -18,6 +19,7 @@ bool CGraphics::g_InterruptLastFrameUsedAbove = false;
ERglLightBits CGraphics::g_LightActive = ERglLightBits::None;
ERglLightBits CGraphics::g_LightsWereOn = ERglLightBits::None;
zeus::CTransform CGraphics::g_GXModelView;
zeus::CTransform CGraphics::g_GXModelViewInvXpose;
zeus::CTransform CGraphics::g_GXModelMatrix;
zeus::CTransform CGraphics::g_ViewMatrix;
zeus::CVector3f CGraphics::g_ViewPoint;
@@ -116,6 +118,8 @@ void CGraphics::SetViewMatrix()
g_GXModelView = g_CameraMatrix * g_GXModelMatrix;
/* Load position matrix */
/* Inverse-transpose */
g_GXModelViewInvXpose = g_GXModelView.inverse();
g_GXModelViewInvXpose.m_basis.transpose();
/* Load normal matrix */
}
@@ -297,6 +301,16 @@ void CGraphics::SetViewportResolution(const zeus::CVector2i& res)
g_ViewportResolutionHalf = {res.x / 2, res.y / 2};
}
CTimeProvider* CGraphics::g_ExternalTimeProvider = nullptr;
float CGraphics::g_DefaultSeconds;
float CGraphics::GetSecondsMod900()
{
if (!g_ExternalTimeProvider)
return g_DefaultSeconds;
return g_ExternalTimeProvider->x0_currentTime;
}
boo::IGraphicsDataFactory* CGraphics::g_BooFactory = nullptr;
boo::IGraphicsCommandQueue* CGraphics::g_BooMainCommandQueue = nullptr;
boo::ITextureR* CGraphics::g_SpareTexture = nullptr;