mirror of https://github.com/AxioDL/metaforce.git
CGraphics: Make use of std::array where applicable
This commit is contained in:
parent
8808a3a324
commit
95199848d3
|
@ -12,7 +12,7 @@ namespace urde {
|
||||||
|
|
||||||
CGraphics::CProjectionState CGraphics::g_Proj;
|
CGraphics::CProjectionState CGraphics::g_Proj;
|
||||||
CGraphics::CFogState CGraphics::g_Fog;
|
CGraphics::CFogState CGraphics::g_Fog;
|
||||||
zeus::CColor CGraphics::g_ColorRegs[3] = {};
|
std::array<zeus::CColor, 3> CGraphics::g_ColorRegs{};
|
||||||
float CGraphics::g_ProjAspect = 1.f;
|
float CGraphics::g_ProjAspect = 1.f;
|
||||||
u32 CGraphics::g_NumLightsActive = 0;
|
u32 CGraphics::g_NumLightsActive = 0;
|
||||||
u32 CGraphics::g_NumBreakpointsWaiting = 0;
|
u32 CGraphics::g_NumBreakpointsWaiting = 0;
|
||||||
|
@ -35,7 +35,7 @@ SViewport g_Viewport = {
|
||||||
};
|
};
|
||||||
u32 CGraphics::g_FrameCounter = 0;
|
u32 CGraphics::g_FrameCounter = 0;
|
||||||
|
|
||||||
const zeus::CMatrix3f CGraphics::skCubeBasisMats[] = {
|
const std::array<zeus::CMatrix3f, 6> CGraphics::skCubeBasisMats{{
|
||||||
/* Right */
|
/* Right */
|
||||||
{0.f, 1.f, 0.f, 1.f, 0.f, 0.f, 0.f, 0.f, -1.f},
|
{0.f, 1.f, 0.f, 1.f, 0.f, 0.f, 0.f, 0.f, -1.f},
|
||||||
/* Left */
|
/* Left */
|
||||||
|
@ -48,7 +48,7 @@ const zeus::CMatrix3f CGraphics::skCubeBasisMats[] = {
|
||||||
{1.f, 0.f, 0.f, 0.f, -1.f, 0.f, 0.f, 0.f, -1.f},
|
{1.f, 0.f, 0.f, 0.f, -1.f, 0.f, 0.f, 0.f, -1.f},
|
||||||
/* Forward */
|
/* Forward */
|
||||||
{-1.f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.f, 0.f, -1.f},
|
{-1.f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.f, 0.f, -1.f},
|
||||||
};
|
}};
|
||||||
|
|
||||||
void CGraphics::DisableAllLights() {
|
void CGraphics::DisableAllLights() {
|
||||||
g_NumLightsActive = 0;
|
g_NumLightsActive = 0;
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <array>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "Runtime/RetroTypes.hpp"
|
#include "Runtime/RetroTypes.hpp"
|
||||||
|
@ -248,7 +249,7 @@ public:
|
||||||
static CProjectionState g_Proj;
|
static CProjectionState g_Proj;
|
||||||
static zeus::CVector2f g_CachedDepthRange;
|
static zeus::CVector2f g_CachedDepthRange;
|
||||||
static CFogState g_Fog;
|
static CFogState g_Fog;
|
||||||
static zeus::CColor g_ColorRegs[3];
|
static std::array<zeus::CColor, 3> g_ColorRegs;
|
||||||
static float g_ProjAspect;
|
static float g_ProjAspect;
|
||||||
static u32 g_NumLightsActive;
|
static u32 g_NumLightsActive;
|
||||||
static u32 g_NumBreakpointsWaiting;
|
static u32 g_NumBreakpointsWaiting;
|
||||||
|
@ -316,7 +317,7 @@ public:
|
||||||
static boo::IGraphicsCommandQueue* g_BooMainCommandQueue;
|
static boo::IGraphicsCommandQueue* g_BooMainCommandQueue;
|
||||||
static boo::ObjToken<boo::ITextureR> g_SpareTexture;
|
static boo::ObjToken<boo::ITextureR> g_SpareTexture;
|
||||||
|
|
||||||
static const zeus::CMatrix3f skCubeBasisMats[6];
|
static const std::array<zeus::CMatrix3f, 6> skCubeBasisMats;
|
||||||
|
|
||||||
static void InitializeBoo(boo::IGraphicsDataFactory* factory, boo::IGraphicsCommandQueue* cc,
|
static void InitializeBoo(boo::IGraphicsDataFactory* factory, boo::IGraphicsCommandQueue* cc,
|
||||||
const boo::ObjToken<boo::ITextureR>& spareTex) {
|
const boo::ObjToken<boo::ITextureR>& spareTex) {
|
||||||
|
|
|
@ -1055,9 +1055,7 @@ boo::ObjToken<boo::IGraphicsBufferD> CBooModel::UpdateUniformData(const CModelFl
|
||||||
} else {
|
} else {
|
||||||
CModelShaders::LightingUniform& lightingOut = *reinterpret_cast<CModelShaders::LightingUniform*>(dataCur);
|
CModelShaders::LightingUniform& lightingOut = *reinterpret_cast<CModelShaders::LightingUniform*>(dataCur);
|
||||||
lightingOut = m_lightingData;
|
lightingOut = m_lightingData;
|
||||||
lightingOut.colorRegs[0] = CGraphics::g_ColorRegs[0];
|
lightingOut.colorRegs = CGraphics::g_ColorRegs;
|
||||||
lightingOut.colorRegs[1] = CGraphics::g_ColorRegs[1];
|
|
||||||
lightingOut.colorRegs[2] = CGraphics::g_ColorRegs[2];
|
|
||||||
lightingOut.mulColor = flags.x4_color;
|
lightingOut.mulColor = flags.x4_color;
|
||||||
lightingOut.addColor = flags.addColor;
|
lightingOut.addColor = flags.addColor;
|
||||||
lightingOut.fog = CGraphics::g_Fog;
|
lightingOut.fog = CGraphics::g_Fog;
|
||||||
|
|
Loading…
Reference in New Issue