2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 15:04:56 +00:00

zeus constexpr refactor and thermal visor fixes

This commit is contained in:
Jack Andersen
2019-02-23 21:15:54 -10:00
parent 1186b8097c
commit 8df0a4913c
226 changed files with 1339 additions and 1305 deletions

View File

@@ -1420,7 +1420,7 @@ void CAutoMapper::Draw(const CStateManager& mgr, const zeus::CTransform& xf, flo
CMapUniverse::CMapUniverseDrawParms parms(universeInterp, x9c_worldIdx, g_GameState->CurrentWorldAssetId(), hexIdx,
x1dc_playerFlashPulse, mgr, planeXf, camXf);
x8_mapu->Draw(parms, zeus::CVector3f::skZero, 0.f, 0.f);
x8_mapu->Draw(parms, zeus::skZero3f, 0.f, 0.f);
}
if (!IsInMapperState(EAutoMapperState::MapScreenUniverse)) {
@@ -1467,7 +1467,7 @@ void CAutoMapper::Draw(const CStateManager& mgr, const zeus::CTransform& xf, flo
const CMapArea* mapa = mw->GetMapArea(loc.xc_areaId);
if (!mapa)
continue;
zeus::CTransform camRot(camXf.buildMatrix3f(), zeus::CVector3f::skZero);
zeus::CTransform camRot(camXf.buildMatrix3f(), zeus::skZero3f);
CGraphics::SetModelMatrix(
mapXf * zeus::CTransform::Translate(mapa->GetAreaPostTransform(*x24_world, loc.xc_areaId).origin) *
zeus::CTransform::Translate(mapa->GetAreaCenterPoint()) * zeus::CTransform::Scale(objectScale) * camRot);
@@ -1484,7 +1484,7 @@ void CAutoMapper::Draw(const CStateManager& mgr, const zeus::CTransform& xf, flo
} else
alpha *= xa8_renderStates[0].x34_alphaSurfaceVisited;
alpha *= mapAlpha;
zeus::CColor color = zeus::CColor::skWhite;
zeus::CColor color = zeus::skWhite;
color.a() = alpha;
filter.drawVerts(color, verts);
}
@@ -1510,7 +1510,7 @@ void CAutoMapper::Draw(const CStateManager& mgr, const zeus::CTransform& xf, flo
}
}
CGraphics::SetDepthRange(DEPTH_NEAR, DEPTH_NEAR);
CGuiWidgetDrawParms parms(frmeAlpha, zeus::CVector3f::skZero);
CGuiWidgetDrawParms parms(frmeAlpha, zeus::skZero3f);
x28_frmeMapScreen->Draw(parms);
CGraphics::SetDepthRange(DEPTH_NEAR, DEPTH_HUD);
}

View File

@@ -164,7 +164,7 @@ const zeus::CVector3f& CMapArea::GetAreaPostTranslate(const IWorld& world, TArea
if (world.IGetWorldAssetId() == g_ResFactory->TranslateOriginalToNew(0xB1AC4D65)) // Phazon Mines
return MinesPostTransforms[MinesPostTransformIndices[aid]];
else
return zeus::CVector3f::skZero;
return zeus::skZero3f;
}
CMapArea::CMapAreaSurface::CMapAreaSurface(const void* surfBuf) {

View File

@@ -28,9 +28,9 @@ CMapUniverse::CMapWorldData::CMapWorldData(CInputStream& in, u32 version)
else
x54_surfColorSelected.fromRGBA32(255 | (u32(x10_worldAssetId.Value()) & 0xFFFFFF00));
x58_outlineColorSelected = zeus::CColor::lerp(zeus::CColor::skWhite, x54_surfColorSelected, 0.5f);
x5c_surfColorUnselected = zeus::CColor::lerp(zeus::CColor::skBlack, x54_surfColorSelected, 0.5f);
x60_outlineColorUnselected = zeus::CColor::lerp(zeus::CColor::skWhite, x5c_surfColorUnselected, 0.5f);
x58_outlineColorSelected = zeus::CColor::lerp(zeus::skWhite, x54_surfColorSelected, 0.5f);
x5c_surfColorUnselected = zeus::CColor::lerp(zeus::skBlack, x54_surfColorSelected, 0.5f);
x60_outlineColorUnselected = zeus::CColor::lerp(zeus::skWhite, x5c_surfColorUnselected, 0.5f);
for (const zeus::CTransform& xf : x44_hexagonXfs)
x64_centerPoint += xf.origin;

View File

@@ -77,7 +77,7 @@ public:
zeus::CColor x58_outlineColorSelected = zeus::CColor(1.0f, 0.0f, 1.0f);
zeus::CColor x5c_surfColorUnselected = zeus::CColor(1.0f, 0.0f, 1.0f);
zeus::CColor x60_outlineColorUnselected = zeus::CColor(1.0f, 0.0f, 1.0f);
zeus::CVector3f x64_centerPoint = zeus::CVector3f::skZero;
zeus::CVector3f x64_centerPoint = zeus::skZero3f;
public:
CMapWorldData(CInputStream& in, u32 version);
@@ -97,7 +97,7 @@ private:
CAssetId x0_hexagonId;
TLockedToken<CMapArea> x4_hexagonToken;
std::vector<CMapWorldData> x10_worldDatas;
zeus::CVector3f x20_universeCenter = zeus::CVector3f::skZero;
zeus::CVector3f x20_universeCenter = zeus::skZero3f;
float x2c_universeRadius = 1600.f;
public:

View File

@@ -259,7 +259,7 @@ void CMapWorld::DrawAreas(const CMapWorld::CMapWorldDrawParms& parms, int selAre
}
zeus::CColor hintFlashColor =
zeus::CColor::lerp(zeus::CColor::skClear, zeus::CColor{1.f, 1.f, 1.f, 0.f}, parms.GetHintAreaFlashIntensity());
zeus::CColor::lerp(zeus::skClear, zeus::CColor{1.f, 1.f, 1.f, 0.f}, parms.GetHintAreaFlashIntensity());
zeus::CColor finalSurfColor, finalOutlineColor;
if (thisArea == selArea && inMapScreen) {

View File

@@ -6,7 +6,7 @@
#include "Graphics/CTexture.hpp"
namespace urde {
const zeus::CVector3f CMappableObject::skDoorVerts[8] = {};
zeus::CVector3f CMappableObject::skDoorVerts[8] = {};
static const u32 DoorIndices[] = {6, 4, 2, 0, 3, 1, 7, 5, 1, 0, 5, 4, 7, 6, 3, 2, 3, 2, 1, 0, 5, 4, 7, 6};
@@ -94,7 +94,7 @@ std::pair<zeus::CColor, zeus::CColor> CMappableObject::GetDoorColors(int curArea
} else if (mwInfo.IsDoorVisited(x8_objId)) {
color = g_tweakAutoMapper->GetOpenDoorColor();
} else {
color = zeus::CColor::skClear;
color = zeus::skClear;
}
color.a() *= alpha;
@@ -121,7 +121,7 @@ void CMappableObject::Draw(int curArea, const CMapWorldInfo& mwInfo, float alpha
}
} else {
CAssetId iconRes;
zeus::CColor iconColor = zeus::CColor::skWhite;
zeus::CColor iconColor = zeus::skWhite;
switch (x0_type) {
case EMappableObjectType::DownArrowYellow:
iconRes = g_tweakPlayerRes->x10_minesBreakFirstTopIcon;
@@ -193,7 +193,7 @@ zeus::CVector3f CMappableObject::BuildSurfaceCenterPoint(int surfIdx) const {
switch (surfIdx) {
case 0:
return x10_transform * zeus::CVector3f::skZero;
return x10_transform * zeus::skZero3f;
case 1:
return x10_transform * zeus::CVector3f{0.f, 0.f, 2.f * doorCenter.x()};
case 2:
@@ -235,7 +235,7 @@ boo::ObjToken<boo::IGraphicsBufferS> CMappableObject::g_doorIbo;
void CMappableObject::ReadAutoMapperTweaks(const ITweakAutoMapper& tweaks) {
const zeus::CVector3f& center = tweaks.GetDoorCenter();
zeus::simd_floats centerF(center.mSimd);
zeus::CVector3f* doorVerts = const_cast<zeus::CVector3f*>(&CMappableObject::skDoorVerts[0]);
zeus::CVector3f* doorVerts = CMappableObject::skDoorVerts;
/* Wrap door verts around -Z to build surface */
doorVerts[0].assign(-centerF[2], -centerF[1], 0.f);
doorVerts[1].assign(-centerF[2], -centerF[1], 2.f * centerF[0]);

View File

@@ -49,7 +49,7 @@ public:
enum class EVisMode { Always, MapStationOrVisit, Visit, Never, MapStationOrVisit2 };
private:
static const zeus::CVector3f skDoorVerts[8];
static zeus::CVector3f skDoorVerts[8];
EMappableObjectType x0_type;
EVisMode x4_visibilityMode;