mirror of https://github.com/AxioDL/metaforce.git
Lots of work on CAutoMapper
This commit is contained in:
parent
0fe125d913
commit
28b1b38a67
|
@ -7,17 +7,38 @@ namespace DataSpec
|
||||||
{
|
{
|
||||||
struct ITweakAutoMapper : public ITweak
|
struct ITweakAutoMapper : public ITweak
|
||||||
{
|
{
|
||||||
virtual const zeus::CVector3f& GetDoorCenter() const=0;
|
virtual bool GetScaleMoveSpeedWithCamDist() const=0;
|
||||||
virtual float GetCamVerticalOffset() const=0;
|
virtual float GetCamDist() const=0;
|
||||||
virtual float GetX28() const=0;
|
virtual float GetMinCamDist() const=0;
|
||||||
virtual float GetX2C() const=0;
|
virtual float GetMaxCamDist() const=0;
|
||||||
virtual float GetX30() const=0;
|
virtual float GetMinCamRotateX() const=0;
|
||||||
|
virtual float GetMaxCamRotateX() const=0;
|
||||||
|
virtual float GetCamAngle() const=0;
|
||||||
|
virtual float GetMiniCamDist() const=0;
|
||||||
|
virtual float GetMiniCamXAngle() const=0;
|
||||||
|
virtual float GetMiniCamAngle() const=0;
|
||||||
|
virtual float GetOpenMapScreenTime() const=0;
|
||||||
|
virtual float GetCloseMapScreenTime() const=0;
|
||||||
|
virtual float GetCamZoomUnitsPerFrame() const=0;
|
||||||
|
virtual float GetCamRotateDegreesPerFrame() const=0;
|
||||||
|
virtual float GetBaseMapScreenCameraMoveSpeed() const=0;
|
||||||
|
virtual float GetMiniAlphaSurfaceVisited() const=0;
|
||||||
virtual float GetAlphaSurfaceVisited() const=0;
|
virtual float GetAlphaSurfaceVisited() const=0;
|
||||||
|
virtual float GetMiniAlphaOutlineVisited() const=0;
|
||||||
virtual float GetAlphaOutlineVisited() const=0;
|
virtual float GetAlphaOutlineVisited() const=0;
|
||||||
|
virtual float GetMiniAlphaSurfaceUnvisited() const=0;
|
||||||
virtual float GetAlphaSurfaceUnvisited() const=0;
|
virtual float GetAlphaSurfaceUnvisited() const=0;
|
||||||
|
virtual float GetMiniAlphaOutlineUnvisited() const=0;
|
||||||
virtual float GetAlphaOutlineUnvisited() const=0;
|
virtual float GetAlphaOutlineUnvisited() const=0;
|
||||||
|
virtual const zeus::CVector3f& GetDoorCenter() const=0;
|
||||||
virtual float GetMiniMapViewportWidth() const=0;
|
virtual float GetMiniMapViewportWidth() const=0;
|
||||||
virtual float GetMiniMapViewportHeight() const=0;
|
virtual float GetMiniMapViewportHeight() const=0;
|
||||||
|
virtual float GetUniverseCamDist() const=0;
|
||||||
|
virtual float GetMinUniverseCamDist() const=0;
|
||||||
|
virtual float GetMaxUniverseCamDist() const=0;
|
||||||
|
virtual float GetSwitchToFromUniverseTime() const=0;
|
||||||
|
virtual float GetCamPanUnitsPerFrame() const=0;
|
||||||
|
virtual float GetCamVerticalOffset() const=0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,18 +13,18 @@ struct CTweakAutoMapper : public ITweakAutoMapper
|
||||||
DECL_YAML
|
DECL_YAML
|
||||||
Value<bool> x4_24_ : 1;
|
Value<bool> x4_24_ : 1;
|
||||||
Value<bool> x4_25_ : 1;
|
Value<bool> x4_25_ : 1;
|
||||||
Value<bool> x4_26_ : 1;
|
Value<bool> x4_26_scaleMoveSpeedWithCamDist : 1;
|
||||||
Value<float> x8_;
|
Value<float> x8_camDist;
|
||||||
Value<float> xc_;
|
Value<float> xc_minCamDist;
|
||||||
Value<float> x10_;
|
Value<float> x10_maxCamDist;
|
||||||
Value<float> x14_;
|
Value<float> x14_minCamRotateX;
|
||||||
Value<float> x18_;
|
Value<float> x18_maxCamRotateX;
|
||||||
Value<float> x1c_;
|
Value<float> x1c_camAngle;
|
||||||
Value<float> x20_;
|
Value<float> x20_;
|
||||||
DNAColor x24_;
|
DNAColor x24_;
|
||||||
Value<float> x28_;
|
Value<float> x28_miniCamDist;
|
||||||
Value<float> x2c_;
|
Value<float> x2c_miniCamXAngle;
|
||||||
Value<float> x30_;
|
Value<float> x30_miniCamAngle;
|
||||||
Value<float> x34_;
|
Value<float> x34_;
|
||||||
DNAColor x38_;
|
DNAColor x38_;
|
||||||
DNAColor x3c_;
|
DNAColor x3c_;
|
||||||
|
@ -37,22 +37,22 @@ struct CTweakAutoMapper : public ITweakAutoMapper
|
||||||
Value<float> x58_;
|
Value<float> x58_;
|
||||||
Value<float> x5c_;
|
Value<float> x5c_;
|
||||||
float x60_ = 0.4f;
|
float x60_ = 0.4f;
|
||||||
Value<float> x64_;
|
Value<float> x64_openMapScreenTime;
|
||||||
Value<float> x68_;
|
Value<float> x68_closeMapScreenTime;
|
||||||
Value<float> x6c_;
|
Value<float> x6c_;
|
||||||
Value<float> x70_;
|
Value<float> x70_zoomUnitsPerFrame;
|
||||||
Value<float> x74_;
|
Value<float> x74_rotateDegPerFrame;
|
||||||
Value<float> x78_;
|
Value<float> x78_baseMapScreenCameraMoveSpeed;
|
||||||
DNAColor x7c_;
|
DNAColor x7c_;
|
||||||
DNAColor x80_;
|
DNAColor x80_;
|
||||||
Value<float> x84_alphaSurfaceVisited;
|
Value<float> x84_miniAlphaSurfaceVisited;
|
||||||
Value<float> x88_;
|
Value<float> x88_alphaSurfaceVisited;
|
||||||
Value<float> x8c_alphaOutlineVisited;
|
Value<float> x8c_miniAlphaOutlineVisited;
|
||||||
Value<float> x90_;
|
Value<float> x90_alphaOutlineVisited;
|
||||||
Value<float> x94_alphaSurfaceUnvisited;
|
Value<float> x94_miniAlphaSurfaceUnvisited;
|
||||||
Value<float> x98_;
|
Value<float> x98_alphaSurfaceUnvisited;
|
||||||
Value<float> x9c_alphaOutlineUnvisited;
|
Value<float> x9c_miniAlphaOutlineUnvisited;
|
||||||
Value<float> xa0_;
|
Value<float> xa0_alphaOutlineUnvisited;
|
||||||
/* Originally 4 separate floats */
|
/* Originally 4 separate floats */
|
||||||
Value<zeus::CVector3f> xa4_doorCenter;
|
Value<zeus::CVector3f> xa4_doorCenter;
|
||||||
Value<float> xb0_;
|
Value<float> xb0_;
|
||||||
|
@ -63,11 +63,11 @@ struct CTweakAutoMapper : public ITweakAutoMapper
|
||||||
Value<float> xc4_;
|
Value<float> xc4_;
|
||||||
Value<float> xc8_;
|
Value<float> xc8_;
|
||||||
Value<bool> xcc_;
|
Value<bool> xcc_;
|
||||||
Value<float> xd0_;
|
Value<float> xd0_universeCamDist;
|
||||||
Value<float> xd4_;
|
Value<float> xd4_minUniverseCamDist;
|
||||||
Value<float> xd8_;
|
Value<float> xd8_maxUniverseCamDist;
|
||||||
Value<float> xdc_;
|
Value<float> xdc_switchToFromUniverseTime;
|
||||||
Value<float> xe0_;
|
Value<float> xe0_camPanUnitsPerFrame;
|
||||||
Value<float> xe4_;
|
Value<float> xe4_;
|
||||||
Value<float> xe8_;
|
Value<float> xe8_;
|
||||||
Value<float> xec_camVerticalOffset;
|
Value<float> xec_camVerticalOffset;
|
||||||
|
@ -82,17 +82,38 @@ struct CTweakAutoMapper : public ITweakAutoMapper
|
||||||
|
|
||||||
CTweakAutoMapper() = default;
|
CTweakAutoMapper() = default;
|
||||||
CTweakAutoMapper(athena::io::IStreamReader& r) { this->read(r); }
|
CTweakAutoMapper(athena::io::IStreamReader& r) { this->read(r); }
|
||||||
|
bool GetScaleMoveSpeedWithCamDist() const { return x4_26_scaleMoveSpeedWithCamDist; }
|
||||||
|
float GetCamDist() const { return x8_camDist; }
|
||||||
|
float GetMinCamDist() const { return xc_minCamDist; }
|
||||||
|
float GetMaxCamDist() const { return x10_maxCamDist; }
|
||||||
|
float GetMinCamRotateX() const { return x14_minCamRotateX; }
|
||||||
|
float GetMaxCamRotateX() const { return x18_maxCamRotateX; }
|
||||||
|
float GetCamAngle() const { return x1c_camAngle; }
|
||||||
|
float GetMiniCamDist() const { return x28_miniCamDist; }
|
||||||
|
float GetMiniCamXAngle() const { return x2c_miniCamXAngle; }
|
||||||
|
float GetMiniCamAngle() const { return x30_miniCamAngle; }
|
||||||
|
float GetOpenMapScreenTime() const { return x64_openMapScreenTime; }
|
||||||
|
float GetCloseMapScreenTime() const { return x68_closeMapScreenTime; }
|
||||||
|
float GetCamZoomUnitsPerFrame() const { return x70_zoomUnitsPerFrame; }
|
||||||
|
float GetCamRotateDegreesPerFrame() const { return x74_rotateDegPerFrame; }
|
||||||
|
float GetBaseMapScreenCameraMoveSpeed() const { return x78_baseMapScreenCameraMoveSpeed; }
|
||||||
|
float GetMiniAlphaSurfaceVisited() const { return x84_miniAlphaSurfaceVisited; }
|
||||||
|
float GetAlphaSurfaceVisited() const { return x88_alphaSurfaceVisited; }
|
||||||
|
float GetMiniAlphaOutlineVisited() const { return x8c_miniAlphaOutlineVisited; }
|
||||||
|
float GetAlphaOutlineVisited() const { return x90_alphaOutlineVisited; }
|
||||||
|
float GetMiniAlphaSurfaceUnvisited() const { return x94_miniAlphaSurfaceUnvisited; }
|
||||||
|
float GetAlphaSurfaceUnvisited() const { return x98_alphaSurfaceUnvisited; }
|
||||||
|
float GetMiniAlphaOutlineUnvisited() const { return x9c_miniAlphaOutlineUnvisited; }
|
||||||
|
float GetAlphaOutlineUnvisited() const { return xa0_alphaOutlineUnvisited; }
|
||||||
const zeus::CVector3f& GetDoorCenter() const { return xa4_doorCenter; }
|
const zeus::CVector3f& GetDoorCenter() const { return xa4_doorCenter; }
|
||||||
float GetCamVerticalOffset() const { return xec_camVerticalOffset; }
|
|
||||||
float GetX28() const { return x28_; }
|
|
||||||
float GetX2C() const { return x2c_; }
|
|
||||||
float GetX30() const { return x30_; }
|
|
||||||
float GetAlphaSurfaceVisited() const { return x84_alphaSurfaceVisited; }
|
|
||||||
float GetAlphaOutlineVisited() const { return x8c_alphaOutlineVisited; }
|
|
||||||
float GetAlphaSurfaceUnvisited() const { return x94_alphaSurfaceUnvisited; }
|
|
||||||
float GetAlphaOutlineUnvisited() const { return x9c_alphaOutlineUnvisited; }
|
|
||||||
float GetMiniMapViewportWidth() const { return xb8_miniMapViewportWidth; }
|
float GetMiniMapViewportWidth() const { return xb8_miniMapViewportWidth; }
|
||||||
float GetMiniMapViewportHeight() const { return xbc_miniMapViewportHeight; }
|
float GetMiniMapViewportHeight() const { return xbc_miniMapViewportHeight; }
|
||||||
|
float GetUniverseCamDist() const { return xd0_universeCamDist; }
|
||||||
|
float GetMinUniverseCamDist() const { return xd4_minUniverseCamDist; }
|
||||||
|
float GetMaxUniverseCamDist() const { return xd8_maxUniverseCamDist; }
|
||||||
|
float GetSwitchToFromUniverseTime() const { return xdc_switchToFromUniverseTime; }
|
||||||
|
float GetCamPanUnitsPerFrame() const { return xe0_camPanUnitsPerFrame; }
|
||||||
|
float GetCamVerticalOffset() const { return xec_camVerticalOffset; }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,7 @@ namespace DNAMP1
|
||||||
struct CTweakPlayerControl : ITweakPlayerControl
|
struct CTweakPlayerControl : ITweakPlayerControl
|
||||||
{
|
{
|
||||||
DECL_YAML
|
DECL_YAML
|
||||||
Vector<atUint32, DNA_COUNT(65)> m_mappings;
|
Vector<atUint32, DNA_COUNT(67)> m_mappings;
|
||||||
atUint32 GetMapping(atUint32 command) const {return m_mappings[command];}
|
atUint32 GetMapping(atUint32 command) const {return m_mappings[command];}
|
||||||
CTweakPlayerControl() = default;
|
CTweakPlayerControl() = default;
|
||||||
CTweakPlayerControl(athena::io::IStreamReader& reader) {this->read(reader);}
|
CTweakPlayerControl(athena::io::IStreamReader& reader) {this->read(reader);}
|
||||||
|
|
|
@ -205,6 +205,19 @@ void CSfxManager::SetChannel(ESfxChannels chan)
|
||||||
m_currentChannel = chan;
|
m_currentChannel = chan;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSfxManager::KillAll(ESfxChannels chan)
|
||||||
|
{
|
||||||
|
CSfxChannel& chanObj = m_channels[int(chan)];
|
||||||
|
for (auto it = chanObj.x48_handles.begin() ; it != chanObj.x48_handles.end() ;)
|
||||||
|
{
|
||||||
|
const CSfxHandle& handle = *it;
|
||||||
|
if (handle->IsPlaying())
|
||||||
|
handle->Stop();
|
||||||
|
handle->Release();
|
||||||
|
it = chanObj.x48_handles.erase(it);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CSfxManager::TurnOnChannel(ESfxChannels chan)
|
void CSfxManager::TurnOnChannel(ESfxChannels chan)
|
||||||
{
|
{
|
||||||
CSfxChannel& chanObj = m_channels[int(chan)];
|
CSfxChannel& chanObj = m_channels[int(chan)];
|
||||||
|
|
|
@ -187,7 +187,7 @@ public:
|
||||||
static bool LoadTranslationTable(CSimplePool* pool, const SObjectTag* tag);
|
static bool LoadTranslationTable(CSimplePool* pool, const SObjectTag* tag);
|
||||||
static bool IsAuxProcessingEnabled() { return m_auxProcessingEnabled; }
|
static bool IsAuxProcessingEnabled() { return m_auxProcessingEnabled; }
|
||||||
static void SetChannel(ESfxChannels);
|
static void SetChannel(ESfxChannels);
|
||||||
static void KillAll(ESfxChannels) {}
|
static void KillAll(ESfxChannels);
|
||||||
static void TurnOnChannel(ESfxChannels);
|
static void TurnOnChannel(ESfxChannels);
|
||||||
static void TurnOffChannel(ESfxChannels);
|
static void TurnOffChannel(ESfxChannels);
|
||||||
static ESfxChannels GetCurrentChannel() {return m_currentChannel;}
|
static ESfxChannels GetCurrentChannel() {return m_currentChannel;}
|
||||||
|
|
|
@ -7,12 +7,85 @@
|
||||||
#include "zeus/CEulerAngles.hpp"
|
#include "zeus/CEulerAngles.hpp"
|
||||||
#include "World/CPlayer.hpp"
|
#include "World/CPlayer.hpp"
|
||||||
#include "Particle/CGenDescription.hpp"
|
#include "Particle/CGenDescription.hpp"
|
||||||
|
#include "MP1/MP1.hpp"
|
||||||
|
#include "Input/ControlMapper.hpp"
|
||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
|
|
||||||
|
void CAutoMapper::SAutoMapperRenderState::InterpolateWithClamp(const SAutoMapperRenderState& a,
|
||||||
|
SAutoMapperRenderState& out,
|
||||||
|
const SAutoMapperRenderState& b,
|
||||||
|
float t)
|
||||||
|
{
|
||||||
|
t = zeus::clamp(0.f, t, 1.f);
|
||||||
|
float easeIn = zeus::clamp(0.f, t * t * t, 1.f);
|
||||||
|
float omt = 1.f - t;
|
||||||
|
float easeOut = zeus::clamp(0.f, 1.f - omt * omt * omt, 1.f);
|
||||||
|
|
||||||
|
float easeInOut;
|
||||||
|
if (t >= 0.5f)
|
||||||
|
easeInOut = zeus::clamp(0.f, 0.5f * std::sqrt(2.f * t - 1.f) + 0.5f, 1.f);
|
||||||
|
else
|
||||||
|
easeInOut = zeus::clamp(0.f, 1.f - (0.5f * std::sqrt(2.f * omt - 1.f) + 0.5f), 1.f);
|
||||||
|
|
||||||
|
float eases[] = {};
|
||||||
|
eases[1] = t;
|
||||||
|
eases[2] = easeOut;
|
||||||
|
eases[3] = easeIn;
|
||||||
|
eases[4] = easeInOut;
|
||||||
|
|
||||||
|
if (b.x44_viewportEase != Ease::None)
|
||||||
|
{
|
||||||
|
float easeB = eases[int(b.x44_viewportEase)];
|
||||||
|
float easeA = 1.f - easeB;
|
||||||
|
out.x0_viewportSize = zeus::CVector2i(b.x0_viewportSize.x * easeB + a.x0_viewportSize.x * easeA,
|
||||||
|
b.x0_viewportSize.y * easeB + a.x0_viewportSize.y * easeA);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (b.x48_camEase != Ease::None)
|
||||||
|
{
|
||||||
|
float easeB = eases[int(b.x48_camEase)];
|
||||||
|
float easeA = 1.f - easeB;
|
||||||
|
out.x8_camOrientation = zeus::CQuaternion::slerp(a.x8_camOrientation, b.x8_camOrientation, easeB);
|
||||||
|
out.x18_camDist = b.x18_camDist * easeB + a.x18_camDist * easeA;
|
||||||
|
out.x1c_camAngle = b.x1c_camAngle * easeB + a.x1c_camAngle * easeA;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (b.x4c_pointEase != Ease::None)
|
||||||
|
{
|
||||||
|
float easeB = eases[int(b.x4c_pointEase)];
|
||||||
|
float easeA = 1.f - easeB;
|
||||||
|
out.x20_areaPoint = b.x20_areaPoint * easeB + a.x20_areaPoint * easeA;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (b.x50_depth1Ease != Ease::None)
|
||||||
|
{
|
||||||
|
float easeB = eases[int(b.x50_depth1Ease)];
|
||||||
|
float easeA = 1.f - easeB;
|
||||||
|
out.x2c_drawDepth1 = b.x2c_drawDepth1 * easeB + a.x2c_drawDepth1 * easeA;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (b.x54_depth2Ease != Ease::None)
|
||||||
|
{
|
||||||
|
float easeB = eases[int(b.x54_depth2Ease)];
|
||||||
|
float easeA = 1.f - easeB;
|
||||||
|
out.x30_drawDepth2 = b.x30_drawDepth2 * easeB + a.x30_drawDepth2 * easeA;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (b.x58_alphaEase != Ease::None)
|
||||||
|
{
|
||||||
|
float easeB = eases[int(b.x58_alphaEase)];
|
||||||
|
float easeA = 1.f - easeB;
|
||||||
|
out.x34_alphaSurfaceVisited = b.x34_alphaSurfaceVisited * easeB + a.x34_alphaSurfaceVisited * easeA;
|
||||||
|
out.x38_alphaOutlineVisited = b.x38_alphaOutlineVisited * easeB + a.x38_alphaOutlineVisited * easeA;
|
||||||
|
out.x3c_alphaSurfaceUnvisited = b.x3c_alphaSurfaceUnvisited * easeB + a.x3c_alphaSurfaceUnvisited * easeA;
|
||||||
|
out.x40_alphaOutlineUnvisited = b.x40_alphaOutlineUnvisited * easeB + a.x40_alphaOutlineUnvisited * easeA;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CAutoMapper::CAutoMapper(CStateManager& stateMgr)
|
CAutoMapper::CAutoMapper(CStateManager& stateMgr)
|
||||||
: x24_world(*stateMgr.WorldNC())
|
: x24_world(stateMgr.WorldNC())
|
||||||
{
|
{
|
||||||
x8_mapu = g_SimplePool->GetObj("MAPU_MapUniverse");
|
x8_mapu = g_SimplePool->GetObj("MAPU_MapUniverse");
|
||||||
x30_miniMapSamus = g_SimplePool->GetObj("CMDL_MiniMapSamus");
|
x30_miniMapSamus = g_SimplePool->GetObj("CMDL_MiniMapSamus");
|
||||||
|
@ -20,7 +93,7 @@ CAutoMapper::CAutoMapper(CStateManager& stateMgr)
|
||||||
|
|
||||||
xa0_curAreaId = xa4_otherAreaId = stateMgr.GetWorld()->IGetCurrentAreaId();
|
xa0_curAreaId = xa4_otherAreaId = stateMgr.GetWorld()->IGetCurrentAreaId();
|
||||||
zeus::CMatrix3f camRot = stateMgr.GetCameraManager()->GetCurrentCamera(stateMgr)->GetTransform().buildMatrix3f();
|
zeus::CMatrix3f camRot = stateMgr.GetCameraManager()->GetCurrentCamera(stateMgr)->GetTransform().buildMatrix3f();
|
||||||
xa8_[0] = xa8_[1] = xa8_[2] = BuildMiniMapWorldRenderState(stateMgr, camRot, xa0_curAreaId);
|
xa8_renderStates[0] = xa8_renderStates[1] = xa8_renderStates[2] = BuildMiniMapWorldRenderState(stateMgr, camRot, xa0_curAreaId);
|
||||||
|
|
||||||
x48_mapIcons.push_back(g_SimplePool->GetObj(SObjectTag{FOURCC('TXTR'), g_tweakPlayerRes->x4_saveStationIcon}));
|
x48_mapIcons.push_back(g_SimplePool->GetObj(SObjectTag{FOURCC('TXTR'), g_tweakPlayerRes->x4_saveStationIcon}));
|
||||||
x48_mapIcons.push_back(g_SimplePool->GetObj(SObjectTag{FOURCC('TXTR'), g_tweakPlayerRes->x8_missileStationIcon}));
|
x48_mapIcons.push_back(g_SimplePool->GetObj(SObjectTag{FOURCC('TXTR'), g_tweakPlayerRes->x8_missileStationIcon}));
|
||||||
|
@ -59,7 +132,7 @@ bool CAutoMapper::CheckLoadComplete()
|
||||||
if (x8_mapu.IsLoaded())
|
if (x8_mapu.IsLoaded())
|
||||||
return false;
|
return false;
|
||||||
x14_dummyWorlds.resize(x8_mapu->GetNumMapWorldDatas());
|
x14_dummyWorlds.resize(x8_mapu->GetNumMapWorldDatas());
|
||||||
SetCurWorldAssetId(x24_world.IGetWorldAssetId());
|
SetCurWorldAssetId(x24_world->IGetWorldAssetId());
|
||||||
x4_loadPhase = ELoadPhase::Done;
|
x4_loadPhase = ELoadPhase::Done;
|
||||||
case ELoadPhase::Done:
|
case ELoadPhase::Done:
|
||||||
return true;
|
return true;
|
||||||
|
@ -68,6 +141,71 @@ bool CAutoMapper::CheckLoadComplete()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CAutoMapper::NotHintNavigating() const
|
||||||
|
{
|
||||||
|
return x1e0_hintSteps.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CAutoMapper::CanLeaveMapScreenInternal(const CStateManager& mgr) const
|
||||||
|
{
|
||||||
|
if (!NotHintNavigating())
|
||||||
|
return false;
|
||||||
|
if (IsRenderStateInterpolating())
|
||||||
|
return false;
|
||||||
|
if (IsInMapperState(EAutoMapperState::MapScreenUniverse))
|
||||||
|
return true;
|
||||||
|
if (x24_world != mgr.GetWorld())
|
||||||
|
return false;
|
||||||
|
if (IsInMapperState(EAutoMapperState::MapScreen))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CAutoMapper::HasCurrentMapUniverseWorld() const
|
||||||
|
{
|
||||||
|
ResId mlvlId = x24_world->IGetWorldAssetId();
|
||||||
|
for (const CMapUniverse::CMapWorldData& wld : *x8_mapu)
|
||||||
|
if (wld.GetWorldAssetId() == mlvlId)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CAutoMapper::CheckDummyWorldLoad(const CStateManager& mgr)
|
||||||
|
{
|
||||||
|
const CMapUniverse::CMapWorldData& mapuWld = x8_mapu->GetMapWorldData(x9c_worldIdx);
|
||||||
|
auto& dummyWorld = x14_dummyWorlds[x9c_worldIdx];
|
||||||
|
if (!dummyWorld)
|
||||||
|
{
|
||||||
|
x32c_loadingDummyWorld = false;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!dummyWorld->ICheckWorldComplete())
|
||||||
|
return true;
|
||||||
|
|
||||||
|
CWorldState& worldState = g_GameState->StateForWorld(dummyWorld->IGetWorldAssetId());
|
||||||
|
CMapWorldInfo& mwInfo = *worldState.MapWorldInfo();
|
||||||
|
zeus::CVector3f localPoint = mapuWld.GetWorldTransform().inverse() * xa8_renderStates[0].x20_areaPoint;
|
||||||
|
zeus::CMatrix3f camRot = xa8_renderStates[0].x8_camOrientation.toTransform().buildMatrix3f();
|
||||||
|
TAreaId aid = FindClosestVisibleArea(localPoint, zeus::CUnitVector3f(camRot[1]), mgr, *dummyWorld, mwInfo);
|
||||||
|
if (aid == -1)
|
||||||
|
{
|
||||||
|
x32c_loadingDummyWorld = false;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
xa0_curAreaId = aid;
|
||||||
|
|
||||||
|
dummyWorld->IMapWorld()->RecalculateWorldSphere(mwInfo, *dummyWorld);
|
||||||
|
BeginMapperStateTransition(EAutoMapperState::MapScreen, mgr);
|
||||||
|
x32c_loadingDummyWorld = false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CAutoMapper::CanLeaveMapScreen(const CStateManager& mgr) const
|
||||||
|
{
|
||||||
|
return x328_ == 3 && CanLeaveMapScreenInternal(mgr);
|
||||||
|
}
|
||||||
|
|
||||||
void CAutoMapper::SetCurWorldAssetId(ResId mlvlId)
|
void CAutoMapper::SetCurWorldAssetId(ResId mlvlId)
|
||||||
{
|
{
|
||||||
int numWorlds = x8_mapu->GetNumMapWorldDatas();
|
int numWorlds = x8_mapu->GetNumMapWorldDatas();
|
||||||
|
@ -79,6 +217,78 @@ void CAutoMapper::SetCurWorldAssetId(ResId mlvlId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CAutoMapper::BeginMapperStateTransition(EAutoMapperState state, const CStateManager& mgr)
|
||||||
|
{
|
||||||
|
if (state == x1c0_nextState)
|
||||||
|
return;
|
||||||
|
if ((state == EAutoMapperState::MiniMap && x1c0_nextState != EAutoMapperState::MiniMap) ||
|
||||||
|
(state != EAutoMapperState::MiniMap && x1c0_nextState == EAutoMapperState::MiniMap))
|
||||||
|
CSfxManager::KillAll(CSfxManager::ESfxChannels::PauseScreen);
|
||||||
|
|
||||||
|
x1bc_state = x1c0_nextState;
|
||||||
|
x1c0_nextState = state;
|
||||||
|
xa8_renderStates[2] = xa8_renderStates[0];
|
||||||
|
xa8_renderStates[1] = xa8_renderStates[0];
|
||||||
|
|
||||||
|
if (x1bc_state == EAutoMapperState::MiniMap && state == EAutoMapperState::MapScreen)
|
||||||
|
{
|
||||||
|
xa8_renderStates[1] = BuildMapScreenWorldRenderState(mgr,
|
||||||
|
xa8_renderStates[0].x8_camOrientation, xa0_curAreaId, false);
|
||||||
|
ResetInterpolationTimer(g_tweakAutoMapper->GetOpenMapScreenTime());
|
||||||
|
}
|
||||||
|
else if (x1bc_state == EAutoMapperState::MapScreen && state == EAutoMapperState::MiniMap)
|
||||||
|
{
|
||||||
|
xa0_curAreaId = x24_world->IGetCurrentAreaId();
|
||||||
|
xa8_renderStates[1] = BuildMiniMapWorldRenderState(mgr,
|
||||||
|
xa8_renderStates[0].x8_camOrientation, xa0_curAreaId);
|
||||||
|
ResetInterpolationTimer(g_tweakAutoMapper->GetCloseMapScreenTime());
|
||||||
|
x1f8_hintLocations.clear();
|
||||||
|
}
|
||||||
|
else if (x1bc_state == EAutoMapperState::MapScreen && state == EAutoMapperState::MapScreenUniverse)
|
||||||
|
{
|
||||||
|
CSfxManager::SfxStart(1426, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId);
|
||||||
|
xa8_renderStates[1] = BuildMapScreenUniverseRenderState(mgr,
|
||||||
|
xa8_renderStates[0].x8_camOrientation, xa0_curAreaId);
|
||||||
|
TransformRenderStatesWorldToUniverse();
|
||||||
|
ResetInterpolationTimer(g_tweakAutoMapper->GetSwitchToFromUniverseTime());
|
||||||
|
}
|
||||||
|
else if (x1bc_state == EAutoMapperState::MapScreenUniverse && state == EAutoMapperState::MapScreen)
|
||||||
|
{
|
||||||
|
CSfxManager::SfxStart(1427, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId);
|
||||||
|
xa8_renderStates[1] = BuildMapScreenWorldRenderState(mgr,
|
||||||
|
xa8_renderStates[0].x8_camOrientation, xa0_curAreaId, x1e0_hintSteps.size());
|
||||||
|
TransformRenderStateWorldToUniverse(xa8_renderStates[1]);
|
||||||
|
ResetInterpolationTimer(g_tweakAutoMapper->GetSwitchToFromUniverseTime());
|
||||||
|
for (auto& wld : x14_dummyWorlds)
|
||||||
|
{
|
||||||
|
if (wld.get() != x24_world || x24_world == mgr.GetWorld())
|
||||||
|
wld.reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (x1bc_state == EAutoMapperState::MapScreenUniverse && state == EAutoMapperState::MiniMap)
|
||||||
|
{
|
||||||
|
x24_world = mgr.GetWorld();
|
||||||
|
xa0_curAreaId = x24_world->IGetCurrentAreaId();
|
||||||
|
xa8_renderStates[1] = BuildMiniMapWorldRenderState(mgr,
|
||||||
|
xa8_renderStates[0].x8_camOrientation, xa0_curAreaId);
|
||||||
|
SetCurWorldAssetId(x24_world->IGetWorldAssetId());
|
||||||
|
TransformRenderStateWorldToUniverse(xa8_renderStates[1]);
|
||||||
|
ResetInterpolationTimer(g_tweakAutoMapper->GetCloseMapScreenTime());
|
||||||
|
x1f8_hintLocations.clear();
|
||||||
|
for (auto& wld : x14_dummyWorlds)
|
||||||
|
{
|
||||||
|
if (wld.get() != x24_world || x24_world == mgr.GetWorld())
|
||||||
|
wld.reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CAutoMapper::ResetInterpolationTimer(float t)
|
||||||
|
{
|
||||||
|
x1c4_ = t;
|
||||||
|
x1c8_ = 0.f;
|
||||||
|
}
|
||||||
|
|
||||||
CAutoMapper::SAutoMapperRenderState
|
CAutoMapper::SAutoMapperRenderState
|
||||||
CAutoMapper::BuildMiniMapWorldRenderState(const CStateManager& stateMgr,
|
CAutoMapper::BuildMiniMapWorldRenderState(const CStateManager& stateMgr,
|
||||||
const zeus::CQuaternion& rot,
|
const zeus::CQuaternion& rot,
|
||||||
|
@ -86,13 +296,432 @@ CAutoMapper::BuildMiniMapWorldRenderState(const CStateManager& stateMgr,
|
||||||
{
|
{
|
||||||
zeus::CQuaternion camOrient = GetMiniMapCameraOrientation(stateMgr);
|
zeus::CQuaternion camOrient = GetMiniMapCameraOrientation(stateMgr);
|
||||||
zeus::CQuaternion useOrient = (camOrient.dot(rot) >= 0.f) ? camOrient : camOrient.buildEquivalent();
|
zeus::CQuaternion useOrient = (camOrient.dot(rot) >= 0.f) ? camOrient : camOrient.buildEquivalent();
|
||||||
return SAutoMapperRenderState(GetMiniMapViewportSize(), useOrient, g_tweakAutoMapper->GetX28(),
|
SAutoMapperRenderState ret(GetMiniMapViewportSize(), useOrient, g_tweakAutoMapper->GetMiniCamDist(),
|
||||||
g_tweakAutoMapper->GetX30(), GetAreaPointOfInterest(stateMgr, area),
|
g_tweakAutoMapper->GetMiniCamAngle(), GetAreaPointOfInterest(stateMgr, area),
|
||||||
GetMapAreaMiniMapDrawDepth(), GetMapAreaMiniMapDrawDepth(),
|
GetMapAreaMiniMapDrawDepth(), GetMapAreaMiniMapDrawDepth(),
|
||||||
GetMapAreaMiniMapDrawAlphaSurfaceVisited(stateMgr),
|
GetMapAreaMiniMapDrawAlphaSurfaceVisited(stateMgr),
|
||||||
GetMapAreaMiniMapDrawAlphaOutlineVisited(stateMgr),
|
GetMapAreaMiniMapDrawAlphaOutlineVisited(stateMgr),
|
||||||
GetMapAreaMiniMapDrawAlphaSurfaceUnvisited(stateMgr),
|
GetMapAreaMiniMapDrawAlphaSurfaceUnvisited(stateMgr),
|
||||||
GetMapAreaMiniMapDrawAlphaOutlineUnvisited(stateMgr));
|
GetMapAreaMiniMapDrawAlphaOutlineUnvisited(stateMgr));
|
||||||
|
ret.x44_viewportEase = SAutoMapperRenderState::Ease::Out;
|
||||||
|
ret.x48_camEase = SAutoMapperRenderState::Ease::Out;
|
||||||
|
ret.x4c_pointEase = SAutoMapperRenderState::Ease::Out;
|
||||||
|
ret.x50_depth1Ease = SAutoMapperRenderState::Ease::Linear;
|
||||||
|
ret.x54_depth2Ease = SAutoMapperRenderState::Ease::In;
|
||||||
|
ret.x58_alphaEase = SAutoMapperRenderState::Ease::Linear;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
CAutoMapper::SAutoMapperRenderState
|
||||||
|
CAutoMapper::BuildMapScreenWorldRenderState(const CStateManager& mgr,
|
||||||
|
const zeus::CQuaternion& rot,
|
||||||
|
TAreaId area, bool doingHint) const
|
||||||
|
{
|
||||||
|
float camDist = doingHint ? g_tweakAutoMapper->GetMaxCamDist() : g_tweakAutoMapper->GetCamDist();
|
||||||
|
SAutoMapperRenderState ret(GetMapScreenViewportSize(), rot, camDist,
|
||||||
|
g_tweakAutoMapper->GetCamAngle(), GetAreaPointOfInterest(mgr, area),
|
||||||
|
GetMapAreaMaxDrawDepth(mgr, area),
|
||||||
|
GetMapAreaMaxDrawDepth(mgr, area),
|
||||||
|
g_tweakAutoMapper->GetAlphaSurfaceVisited(),
|
||||||
|
g_tweakAutoMapper->GetAlphaOutlineVisited(),
|
||||||
|
g_tweakAutoMapper->GetAlphaSurfaceUnvisited(),
|
||||||
|
g_tweakAutoMapper->GetAlphaOutlineUnvisited());
|
||||||
|
ret.x44_viewportEase = SAutoMapperRenderState::Ease::Out;
|
||||||
|
ret.x48_camEase = SAutoMapperRenderState::Ease::Linear;
|
||||||
|
ret.x4c_pointEase = SAutoMapperRenderState::Ease::Out;
|
||||||
|
ret.x50_depth1Ease = SAutoMapperRenderState::Ease::Linear;
|
||||||
|
ret.x54_depth2Ease = SAutoMapperRenderState::Ease::Out;
|
||||||
|
ret.x58_alphaEase = SAutoMapperRenderState::Ease::Linear;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
CAutoMapper::SAutoMapperRenderState
|
||||||
|
CAutoMapper::BuildMapScreenUniverseRenderState(const CStateManager& mgr,
|
||||||
|
const zeus::CQuaternion& rot,
|
||||||
|
TAreaId area) const
|
||||||
|
{
|
||||||
|
SAutoMapperRenderState ret(GetMapScreenViewportSize(), rot, g_tweakAutoMapper->GetUniverseCamDist(),
|
||||||
|
g_tweakAutoMapper->GetCamAngle(), GetAreaPointOfInterest(mgr, area),
|
||||||
|
GetMapAreaMaxDrawDepth(mgr, area),
|
||||||
|
GetMapAreaMaxDrawDepth(mgr, area),
|
||||||
|
0.f, 0.f, 0.f, 0.f);
|
||||||
|
ret.x44_viewportEase = SAutoMapperRenderState::Ease::Out;
|
||||||
|
ret.x48_camEase = SAutoMapperRenderState::Ease::Linear;
|
||||||
|
ret.x4c_pointEase = SAutoMapperRenderState::Ease::Out;
|
||||||
|
ret.x50_depth1Ease = SAutoMapperRenderState::Ease::Linear;
|
||||||
|
ret.x54_depth2Ease = SAutoMapperRenderState::Ease::Out;
|
||||||
|
ret.x58_alphaEase = SAutoMapperRenderState::Ease::Linear;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CAutoMapper::LeaveMapScreenState()
|
||||||
|
{
|
||||||
|
SetShouldPanningSoundBePlaying(false);
|
||||||
|
SetShouldZoomingSoundBePlaying(false);
|
||||||
|
SetShouldRotatingSoundBePlaying(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
float CAutoMapper::GetBaseMapScreenCameraMoveSpeed()
|
||||||
|
{
|
||||||
|
return g_tweakAutoMapper->GetBaseMapScreenCameraMoveSpeed();
|
||||||
|
}
|
||||||
|
|
||||||
|
float CAutoMapper::GetFinalMapScreenCameraMoveSpeed() const
|
||||||
|
{
|
||||||
|
float ret = GetBaseMapScreenCameraMoveSpeed();
|
||||||
|
if (g_tweakAutoMapper->GetScaleMoveSpeedWithCamDist())
|
||||||
|
ret = ret * xa8_renderStates[0].x18_camDist / g_tweakAutoMapper->GetCamDist();
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CAutoMapper::ProcessMapRotateInput(const CFinalInput& input, const CStateManager& mgr)
|
||||||
|
{
|
||||||
|
float up = ControlMapper::GetAnalogInput(ControlMapper::ECommands::MapCircleUp, input);
|
||||||
|
float down = ControlMapper::GetAnalogInput(ControlMapper::ECommands::MapCircleDown, input);
|
||||||
|
float left = ControlMapper::GetAnalogInput(ControlMapper::ECommands::MapCircleLeft, input);
|
||||||
|
float right = ControlMapper::GetAnalogInput(ControlMapper::ECommands::MapCircleRight, input);
|
||||||
|
int flags = 0x0;
|
||||||
|
if (up > 0.f)
|
||||||
|
flags |= 0x2;
|
||||||
|
if (down > 0.f)
|
||||||
|
flags |= 0x1;
|
||||||
|
if (left > 0.f)
|
||||||
|
flags |= 0x4;
|
||||||
|
if (right > 0.f)
|
||||||
|
flags |= 0x8;
|
||||||
|
|
||||||
|
switch (flags)
|
||||||
|
{
|
||||||
|
case 1: // Down
|
||||||
|
x2e4_lStickPos = 1;
|
||||||
|
break;
|
||||||
|
case 2: // Up
|
||||||
|
x2e4_lStickPos = 5;
|
||||||
|
break;
|
||||||
|
case 4: // Left
|
||||||
|
x2e4_lStickPos = 3;
|
||||||
|
break;
|
||||||
|
case 5: // Down-Left
|
||||||
|
x2e4_lStickPos = 2;
|
||||||
|
break;
|
||||||
|
case 6: // Up-Left
|
||||||
|
x2e4_lStickPos = 4;
|
||||||
|
break;
|
||||||
|
case 8: // Right
|
||||||
|
x2e4_lStickPos = 7;
|
||||||
|
break;
|
||||||
|
case 9: // Down-Right
|
||||||
|
x2e4_lStickPos = 8;
|
||||||
|
break;
|
||||||
|
case 10: // Up-Right
|
||||||
|
x2e4_lStickPos = 6;
|
||||||
|
break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
|
||||||
|
float maxMag = up;
|
||||||
|
int dirSlot = 0;
|
||||||
|
if (down > up)
|
||||||
|
{
|
||||||
|
maxMag = down;
|
||||||
|
dirSlot = 1;
|
||||||
|
}
|
||||||
|
if (left > maxMag)
|
||||||
|
{
|
||||||
|
maxMag = left;
|
||||||
|
dirSlot = 2;
|
||||||
|
}
|
||||||
|
if (right > maxMag)
|
||||||
|
{
|
||||||
|
maxMag = right;
|
||||||
|
dirSlot = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
float dirs[4] = {};
|
||||||
|
dirs[dirSlot] = maxMag;
|
||||||
|
|
||||||
|
if (dirs[0] > 0.f || dirs[1] > 0.f || dirs[2] > 0.f || dirs[3] > 0.f)
|
||||||
|
{
|
||||||
|
float deltaFrames = input.DeltaTime() * 60.f;
|
||||||
|
SetShouldRotatingSoundBePlaying(true);
|
||||||
|
zeus::CEulerAngles eulers(xa8_renderStates[0].x8_camOrientation);
|
||||||
|
float angX = eulers.x - std::floor(eulers.x / (2.f * M_PIF)) * 2.f * M_PIF;
|
||||||
|
if (angX < 0.f)
|
||||||
|
angX += 2.f * M_PIF;
|
||||||
|
float angZ = eulers.z - std::floor(eulers.z / (2.f * M_PIF)) * 2.f * M_PIF;
|
||||||
|
if (angZ < 0.f)
|
||||||
|
angZ += 2.f * M_PIF;
|
||||||
|
|
||||||
|
float dt = deltaFrames * g_tweakAutoMapper->GetCamRotateDegreesPerFrame();
|
||||||
|
|
||||||
|
angZ -= zeus::degToRad(dt * dirs[2]);
|
||||||
|
if (angZ - std::floor(angZ / (2.f * M_PIF)) * 2.f * M_PIF < 0.f)
|
||||||
|
angZ += 2.f * M_PIF;
|
||||||
|
angZ += zeus::degToRad(dt * dirs[3]);
|
||||||
|
if (angZ - std::floor(angZ / (2.f * M_PIF)) * 2.f * M_PIF < 0.f)
|
||||||
|
angZ += 2.f * M_PIF;
|
||||||
|
|
||||||
|
angX -= zeus::degToRad(dt * dirs[0]);
|
||||||
|
if (angX - std::floor(angX / (2.f * M_PIF)) * 2.f * M_PIF < 0.f)
|
||||||
|
angX += 2.f * M_PIF;
|
||||||
|
angX += zeus::degToRad(dt * dirs[1]);
|
||||||
|
if (angX - std::floor(angX / (2.f * M_PIF)) * 2.f * M_PIF < 0.f)
|
||||||
|
angX += 2.f * M_PIF;
|
||||||
|
|
||||||
|
angX = zeus::radToDeg(angX);
|
||||||
|
if (angX > 180.f)
|
||||||
|
angX -= 360.f;
|
||||||
|
angX = zeus::degToRad(zeus::clamp(g_tweakAutoMapper->GetMinCamRotateX(), angX,
|
||||||
|
g_tweakAutoMapper->GetMaxCamRotateX()));
|
||||||
|
if (angX - std::floor(angX / (2.f * M_PIF)) * 2.f * M_PIF < 0.f)
|
||||||
|
angX += 2.f * M_PIF;
|
||||||
|
|
||||||
|
zeus::CQuaternion quat;
|
||||||
|
quat.rotateZ(angZ);
|
||||||
|
quat.rotateX(angX);
|
||||||
|
quat.rotateY(0.f);
|
||||||
|
xa8_renderStates[0].x8_camOrientation = quat;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetShouldRotatingSoundBePlaying(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CAutoMapper::ProcessMapZoomInput(const CFinalInput& input, const CStateManager& mgr)
|
||||||
|
{
|
||||||
|
bool in = ControlMapper::GetDigitalInput(ControlMapper::ECommands::MapZoomIn, input);
|
||||||
|
bool out = ControlMapper::GetDigitalInput(ControlMapper::ECommands::MapZoomOut, input);
|
||||||
|
|
||||||
|
EZoomState nextZoomState = EZoomState::None;
|
||||||
|
switch (x324_zoomState)
|
||||||
|
{
|
||||||
|
case EZoomState::None:
|
||||||
|
if (in)
|
||||||
|
nextZoomState = EZoomState::In;
|
||||||
|
else if (out)
|
||||||
|
nextZoomState = EZoomState::Out;
|
||||||
|
break;
|
||||||
|
case EZoomState::In:
|
||||||
|
if (in)
|
||||||
|
nextZoomState = EZoomState::In;
|
||||||
|
else if (out)
|
||||||
|
nextZoomState = EZoomState::Out;
|
||||||
|
break;
|
||||||
|
case EZoomState::Out:
|
||||||
|
if (in)
|
||||||
|
nextZoomState = EZoomState::In;
|
||||||
|
else if (out)
|
||||||
|
nextZoomState = EZoomState::Out;
|
||||||
|
break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
|
||||||
|
x324_zoomState = nextZoomState;
|
||||||
|
float delta = input.DeltaTime() * 60.f * (x1bc_state == EAutoMapperState::MapScreen ? 1.f : 4.f) *
|
||||||
|
g_tweakAutoMapper->GetCamZoomUnitsPerFrame();
|
||||||
|
float oldDist = xa8_renderStates[0].x18_camDist;
|
||||||
|
if (x324_zoomState == EZoomState::In)
|
||||||
|
{
|
||||||
|
xa8_renderStates[0].x18_camDist =
|
||||||
|
GetClampedMapScreenCameraDistance(xa8_renderStates[0].x18_camDist - delta);
|
||||||
|
x2f0_ = 1;
|
||||||
|
x324_zoomState = EZoomState::In;
|
||||||
|
}
|
||||||
|
else if (x324_zoomState == EZoomState::Out)
|
||||||
|
{
|
||||||
|
xa8_renderStates[0].x18_camDist =
|
||||||
|
GetClampedMapScreenCameraDistance(xa8_renderStates[0].x18_camDist + delta);
|
||||||
|
x2ec_ = 1;
|
||||||
|
x324_zoomState = EZoomState::Out;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (oldDist == xa8_renderStates[0].x18_camDist)
|
||||||
|
SetShouldZoomingSoundBePlaying(false);
|
||||||
|
else
|
||||||
|
SetShouldZoomingSoundBePlaying(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CAutoMapper::ProcessMapPanInput(const CFinalInput& input, const CStateManager& mgr)
|
||||||
|
{
|
||||||
|
float forward = ControlMapper::GetAnalogInput(ControlMapper::ECommands::MapMoveForward, input);
|
||||||
|
float back = ControlMapper::GetAnalogInput(ControlMapper::ECommands::MapMoveBack, input);
|
||||||
|
float left = ControlMapper::GetAnalogInput(ControlMapper::ECommands::MapMoveLeft, input);
|
||||||
|
float right = ControlMapper::GetAnalogInput(ControlMapper::ECommands::MapMoveRight, input);
|
||||||
|
zeus::CTransform camRot = xa8_renderStates[0].x8_camOrientation.toTransform();
|
||||||
|
if (forward > 0.f || back > 0.f || left > 0.f || right > 0.f)
|
||||||
|
{
|
||||||
|
float deltaFrames = 60.f * input.DeltaTime();
|
||||||
|
float speed = GetFinalMapScreenCameraMoveSpeed();
|
||||||
|
int flags = 0x0;
|
||||||
|
if (forward > 0.f)
|
||||||
|
flags |= 0x1;
|
||||||
|
if (back > 0.f)
|
||||||
|
flags |= 0x2;
|
||||||
|
if (left > 0.f)
|
||||||
|
flags |= 0x4;
|
||||||
|
if (right > 0.f)
|
||||||
|
flags |= 0x8;
|
||||||
|
|
||||||
|
switch (flags)
|
||||||
|
{
|
||||||
|
case 1: // Forward
|
||||||
|
x2e8_rStickPos = 1;
|
||||||
|
break;
|
||||||
|
case 2: // Back
|
||||||
|
x2e8_rStickPos = 5;
|
||||||
|
break;
|
||||||
|
case 4: // Left
|
||||||
|
x2e8_rStickPos = 3;
|
||||||
|
break;
|
||||||
|
case 5: // Forward-Left
|
||||||
|
x2e8_rStickPos = 2;
|
||||||
|
break;
|
||||||
|
case 6: // Back-Left
|
||||||
|
x2e8_rStickPos = 4;
|
||||||
|
break;
|
||||||
|
case 8: // Right
|
||||||
|
x2e8_rStickPos = 7;
|
||||||
|
break;
|
||||||
|
case 9: // Forward-Right
|
||||||
|
x2e8_rStickPos = 8;
|
||||||
|
break;
|
||||||
|
case 10: // Back-Right
|
||||||
|
x2e8_rStickPos = 6;
|
||||||
|
break;
|
||||||
|
default: break;
|
||||||
|
}
|
||||||
|
|
||||||
|
zeus::CVector3f dirVec(right - left, 0.f, forward - back);
|
||||||
|
zeus::CVector3f deltaVec = camRot * (dirVec * deltaFrames * speed);
|
||||||
|
zeus::CVector3f newPoint = xa8_renderStates[0].x20_areaPoint + deltaVec;
|
||||||
|
if (deltaVec.magnitude() > input.DeltaTime())
|
||||||
|
SetShouldPanningSoundBePlaying(true);
|
||||||
|
else
|
||||||
|
SetShouldPanningSoundBePlaying(false);
|
||||||
|
|
||||||
|
if (x1bc_state == EAutoMapperState::MapScreen)
|
||||||
|
{
|
||||||
|
xa8_renderStates[0].x20_areaPoint =
|
||||||
|
x24_world->IGetMapWorld()->ConstrainToWorldVolume(newPoint, camRot.basis[1]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
zeus::CVector3f localPoint = newPoint - x8_mapu->GetMapUniverseCenterPoint();
|
||||||
|
if (localPoint.magnitude() > x8_mapu->GetMapUniverseRadius())
|
||||||
|
newPoint = x8_mapu->GetMapUniverseCenterPoint() + localPoint.normalized() * x8_mapu->GetMapUniverseRadius();
|
||||||
|
xa8_renderStates[0].x20_areaPoint = newPoint;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetShouldPanningSoundBePlaying(false);
|
||||||
|
float speed = g_tweakAutoMapper->GetCamPanUnitsPerFrame() * GetBaseMapScreenCameraMoveSpeed();
|
||||||
|
if (x1bc_state == EAutoMapperState::MapScreen)
|
||||||
|
{
|
||||||
|
const CMapArea* area = x24_world->IGetMapWorld()->GetMapArea(xa0_curAreaId);
|
||||||
|
zeus::CVector3f worldPoint = area->GetAreaPostTransform(*x24_world, xa0_curAreaId) * area->GetAreaCenterPoint();
|
||||||
|
zeus::CVector3f viewPoint = worldPoint - xa8_renderStates[0].x20_areaPoint;
|
||||||
|
if (viewPoint.magnitude() < speed)
|
||||||
|
xa8_renderStates[0].x20_areaPoint = worldPoint;
|
||||||
|
else
|
||||||
|
xa8_renderStates[0].x20_areaPoint += viewPoint.normalized() * speed;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::pair<TAreaId, int> areas = FindClosestVisibleWorld(xa8_renderStates[0].x20_areaPoint, camRot.basis[1], mgr);
|
||||||
|
const zeus::CTransform& hex = x8_mapu->GetMapWorldData(areas.first).GetMapAreaData(areas.second);
|
||||||
|
zeus::CVector3f areaToHex = hex.origin - xa8_renderStates[0].x20_areaPoint;
|
||||||
|
if (areaToHex.magnitude() < speed)
|
||||||
|
xa8_renderStates[0].x20_areaPoint = hex.origin;
|
||||||
|
else
|
||||||
|
xa8_renderStates[0].x20_areaPoint += areaToHex.normalized() * speed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CAutoMapper::SetShouldPanningSoundBePlaying(bool b)
|
||||||
|
{
|
||||||
|
if (b)
|
||||||
|
{
|
||||||
|
if (!x1cc_panningSfx)
|
||||||
|
x1cc_panningSfx = CSfxManager::SfxStart(1406, 1.f, 0.f, false, 0x7f, true, kInvalidAreaId);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CSfxManager::SfxStop(x1cc_panningSfx);
|
||||||
|
x1cc_panningSfx.reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CAutoMapper::SetShouldZoomingSoundBePlaying(bool b)
|
||||||
|
{
|
||||||
|
if (b)
|
||||||
|
{
|
||||||
|
if (!x1d4_zoomingSfx)
|
||||||
|
x1d4_zoomingSfx = CSfxManager::SfxStart(1376, 1.f, 0.f, false, 0x7f, true, kInvalidAreaId);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CSfxManager::SfxStop(x1d4_zoomingSfx);
|
||||||
|
x1d4_zoomingSfx.reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CAutoMapper::SetShouldRotatingSoundBePlaying(bool b)
|
||||||
|
{
|
||||||
|
if (b)
|
||||||
|
{
|
||||||
|
if (!x1d0_rotatingSfx)
|
||||||
|
x1d0_rotatingSfx = CSfxManager::SfxStart(1375, 1.f, 0.f, false, 0x7f, true, kInvalidAreaId);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CSfxManager::SfxStop(x1d0_rotatingSfx);
|
||||||
|
x1d0_rotatingSfx.reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CAutoMapper::ProcessMapScreenInput(const CFinalInput& input, const CStateManager& mgr)
|
||||||
|
{
|
||||||
|
zeus::CMatrix3f camRot = xa8_renderStates[0].x8_camOrientation.toTransform().buildMatrix3f();
|
||||||
|
if (x1bc_state == EAutoMapperState::MapScreen)
|
||||||
|
{
|
||||||
|
if (input.PA() && !x328_ && HasCurrentMapUniverseWorld())
|
||||||
|
BeginMapperStateTransition(EAutoMapperState::MapScreenUniverse, mgr);
|
||||||
|
}
|
||||||
|
else if (x1bc_state == EAutoMapperState::MapScreenUniverse && input.PA())
|
||||||
|
{
|
||||||
|
const CMapUniverse::CMapWorldData& mapuWld = x8_mapu->GetMapWorldData(x9c_worldIdx);
|
||||||
|
zeus::CVector3f pointLocal = mapuWld.GetWorldTransform().inverse() * xa8_renderStates[0].x20_areaPoint;
|
||||||
|
if (mapuWld.GetWorldAssetId() != g_GameState->CurrentWorldAssetId())
|
||||||
|
{
|
||||||
|
x32c_loadingDummyWorld = true;
|
||||||
|
CheckDummyWorldLoad(mgr);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x24_world = mgr.GetWorld();
|
||||||
|
CMapWorldInfo& mwInfo = *g_GameState->StateForWorld(x24_world->IGetWorldAssetId()).MapWorldInfo();
|
||||||
|
xa0_curAreaId = FindClosestVisibleArea(pointLocal, zeus::CUnitVector3f(camRot[1]), mgr, *x24_world, mwInfo);
|
||||||
|
BeginMapperStateTransition(EAutoMapperState::MapScreen, mgr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
x2f4_ = 0;
|
||||||
|
if (input.PA())
|
||||||
|
x2f4_ = 1;
|
||||||
|
|
||||||
|
if (IsInMapperState(EAutoMapperState::MapScreen) || IsInMapperState(EAutoMapperState::MapScreenUniverse))
|
||||||
|
{
|
||||||
|
x2e4_lStickPos = 0;
|
||||||
|
x2e8_rStickPos = 0;
|
||||||
|
x2ec_ = 0;
|
||||||
|
x2f0_ = 0;
|
||||||
|
ProcessMapRotateInput(input, mgr);
|
||||||
|
ProcessMapZoomInput(input, mgr);
|
||||||
|
ProcessMapPanInput(input, mgr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
zeus::CQuaternion CAutoMapper::GetMiniMapCameraOrientation(const CStateManager& stateMgr) const
|
zeus::CQuaternion CAutoMapper::GetMiniMapCameraOrientation(const CStateManager& stateMgr) const
|
||||||
|
@ -105,14 +734,26 @@ zeus::CQuaternion CAutoMapper::GetMiniMapCameraOrientation(const CStateManager&
|
||||||
|
|
||||||
zeus::CQuaternion ret;
|
zeus::CQuaternion ret;
|
||||||
ret.rotateZ(rotMod);
|
ret.rotateZ(rotMod);
|
||||||
ret.rotateX(zeus::degToRad(g_tweakAutoMapper->GetX2C()));
|
ret.rotateX(zeus::degToRad(g_tweakAutoMapper->GetMiniCamXAngle()));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
zeus::CVector3f CAutoMapper::GetAreaPointOfInterest(const CStateManager&, TAreaId aid) const
|
zeus::CVector3f CAutoMapper::GetAreaPointOfInterest(const CStateManager&, TAreaId aid) const
|
||||||
{
|
{
|
||||||
const CMapArea* mapa = x24_world.IGetMapWorld()->GetMapArea(aid);
|
const CMapArea* mapa = x24_world->IGetMapWorld()->GetMapArea(aid);
|
||||||
return mapa->GetAreaPostTransform(x24_world, aid) * mapa->GetAreaCenterPoint();
|
return mapa->GetAreaPostTransform(*x24_world, aid) * mapa->GetAreaCenterPoint();
|
||||||
|
}
|
||||||
|
|
||||||
|
TAreaId CAutoMapper::FindClosestVisibleArea(const zeus::CVector3f&, const zeus::CUnitVector3f&, const CStateManager&,
|
||||||
|
const IWorld&, const CMapWorldInfo&) const
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::pair<TAreaId, int>
|
||||||
|
CAutoMapper::FindClosestVisibleWorld(const zeus::CVector3f&, const zeus::CUnitVector3f&, const CStateManager&) const
|
||||||
|
{
|
||||||
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
zeus::CVector2i CAutoMapper::GetMiniMapViewportSize()
|
zeus::CVector2i CAutoMapper::GetMiniMapViewportSize()
|
||||||
|
@ -123,42 +764,178 @@ zeus::CVector2i CAutoMapper::GetMiniMapViewportSize()
|
||||||
int(scaleY * g_tweakAutoMapper->GetMiniMapViewportHeight())};
|
int(scaleY * g_tweakAutoMapper->GetMiniMapViewportHeight())};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
zeus::CVector2i CAutoMapper::GetMapScreenViewportSize()
|
||||||
|
{
|
||||||
|
return {g_Viewport.x8_width, g_Viewport.xc_height};
|
||||||
|
}
|
||||||
|
|
||||||
|
float CAutoMapper::GetMapAreaMaxDrawDepth(const CStateManager&, TAreaId aid) const
|
||||||
|
{
|
||||||
|
return x24_world->IGetMapWorld()->GetCurrentMapAreaDepth(*x24_world, aid);
|
||||||
|
}
|
||||||
|
|
||||||
float CAutoMapper::GetMapAreaMiniMapDrawAlphaSurfaceVisited(const CStateManager& stateMgr)
|
float CAutoMapper::GetMapAreaMiniMapDrawAlphaSurfaceVisited(const CStateManager& stateMgr)
|
||||||
{
|
{
|
||||||
float mapAlphaInterp = g_tweakGui->GetMapAlphaInterpolant();
|
float mapAlphaInterp = g_tweakGui->GetMapAlphaInterpolant();
|
||||||
return g_tweakAutoMapper->GetAlphaOutlineUnvisited() * (1.f - mapAlphaInterp) *
|
return g_tweakAutoMapper->GetMiniAlphaSurfaceVisited() * (1.f - mapAlphaInterp) *
|
||||||
stateMgr.Player()->GetMapAlpha() + mapAlphaInterp;
|
stateMgr.Player()->GetMapAlpha() + mapAlphaInterp;
|
||||||
}
|
}
|
||||||
|
|
||||||
float CAutoMapper::GetMapAreaMiniMapDrawAlphaOutlineVisited(const CStateManager& stateMgr)
|
float CAutoMapper::GetMapAreaMiniMapDrawAlphaOutlineVisited(const CStateManager& stateMgr)
|
||||||
{
|
{
|
||||||
float mapAlphaInterp = g_tweakGui->GetMapAlphaInterpolant();
|
float mapAlphaInterp = g_tweakGui->GetMapAlphaInterpolant();
|
||||||
return g_tweakAutoMapper->GetAlphaOutlineVisited() * (1.f - mapAlphaInterp) *
|
return g_tweakAutoMapper->GetMiniAlphaOutlineVisited() * (1.f - mapAlphaInterp) *
|
||||||
stateMgr.Player()->GetMapAlpha() + mapAlphaInterp;
|
stateMgr.Player()->GetMapAlpha() + mapAlphaInterp;
|
||||||
}
|
}
|
||||||
|
|
||||||
float CAutoMapper::GetMapAreaMiniMapDrawAlphaSurfaceUnvisited(const CStateManager& stateMgr)
|
float CAutoMapper::GetMapAreaMiniMapDrawAlphaSurfaceUnvisited(const CStateManager& stateMgr)
|
||||||
{
|
{
|
||||||
float mapAlphaInterp = g_tweakGui->GetMapAlphaInterpolant();
|
float mapAlphaInterp = g_tweakGui->GetMapAlphaInterpolant();
|
||||||
return g_tweakAutoMapper->GetAlphaSurfaceUnvisited() * (1.f - mapAlphaInterp) *
|
return g_tweakAutoMapper->GetMiniAlphaSurfaceUnvisited() * (1.f - mapAlphaInterp) *
|
||||||
stateMgr.Player()->GetMapAlpha() + mapAlphaInterp;
|
stateMgr.Player()->GetMapAlpha() + mapAlphaInterp;
|
||||||
}
|
}
|
||||||
|
|
||||||
float CAutoMapper::GetMapAreaMiniMapDrawAlphaOutlineUnvisited(const CStateManager& stateMgr)
|
float CAutoMapper::GetMapAreaMiniMapDrawAlphaOutlineUnvisited(const CStateManager& stateMgr)
|
||||||
{
|
{
|
||||||
float mapAlphaInterp = g_tweakGui->GetMapAlphaInterpolant();
|
float mapAlphaInterp = g_tweakGui->GetMapAlphaInterpolant();
|
||||||
return g_tweakAutoMapper->GetAlphaOutlineUnvisited() * (1.f - mapAlphaInterp) *
|
return g_tweakAutoMapper->GetMiniAlphaOutlineUnvisited() * (1.f - mapAlphaInterp) *
|
||||||
stateMgr.Player()->GetMapAlpha() + mapAlphaInterp;
|
stateMgr.Player()->GetMapAlpha() + mapAlphaInterp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float CAutoMapper::GetClampedMapScreenCameraDistance(float v)
|
||||||
|
{
|
||||||
|
if (x1bc_state == EAutoMapperState::MapScreenUniverse)
|
||||||
|
return zeus::clamp(g_tweakAutoMapper->GetMinUniverseCamDist(), v,
|
||||||
|
g_tweakAutoMapper->GetMaxUniverseCamDist());
|
||||||
|
return zeus::clamp(g_tweakAutoMapper->GetMinCamDist(), v,
|
||||||
|
g_tweakAutoMapper->GetMaxCamDist());
|
||||||
|
}
|
||||||
|
|
||||||
void CAutoMapper::UnmuteAllLoopedSounds()
|
void CAutoMapper::UnmuteAllLoopedSounds()
|
||||||
{
|
{
|
||||||
|
CSfxManager::SfxVolume(x1cc_panningSfx, 1.f);
|
||||||
|
CSfxManager::SfxVolume(x1d0_rotatingSfx, 1.f);
|
||||||
|
CSfxManager::SfxVolume(x1d4_zoomingSfx, 1.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAutoMapper::OnNewInGameGuiState(EInGameGuiState, const CStateManager&)
|
void CAutoMapper::ProcessControllerInput(const CFinalInput& input, CStateManager& mgr)
|
||||||
{
|
{
|
||||||
|
if (!IsRenderStateInterpolating())
|
||||||
|
{
|
||||||
|
if (IsInMapperState(EAutoMapperState::MapScreen) || IsInMapperState(EAutoMapperState::MapScreenUniverse))
|
||||||
|
{
|
||||||
|
if (x32c_loadingDummyWorld)
|
||||||
|
{
|
||||||
|
/* TODO: Finish */
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CAutoMapper::TransformRenderStatesWorldToUniverse()
|
||||||
|
{
|
||||||
|
const CMapUniverse::CMapWorldData& mapuWld = x8_mapu->GetMapWorldData(x9c_worldIdx);
|
||||||
|
zeus::CQuaternion rot = zeus::CQuaternion(mapuWld.GetWorldTransform().buildMatrix3f());
|
||||||
|
xa8_renderStates[2].x8_camOrientation *= rot;
|
||||||
|
xa8_renderStates[2].x20_areaPoint = mapuWld.GetWorldTransform() * xa8_renderStates[2].x20_areaPoint;
|
||||||
|
xa8_renderStates[0].x8_camOrientation *= rot;
|
||||||
|
xa8_renderStates[0].x20_areaPoint = mapuWld.GetWorldTransform() * xa8_renderStates[0].x20_areaPoint;
|
||||||
|
xa8_renderStates[1].x8_camOrientation *= rot;
|
||||||
|
xa8_renderStates[1].x20_areaPoint = mapuWld.GetWorldTransform() * xa8_renderStates[1].x20_areaPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CAutoMapper::TransformRenderStatesUniverseToWorld()
|
||||||
|
{
|
||||||
|
const CMapUniverse::CMapWorldData& mapuWld = x8_mapu->GetMapWorldData(x9c_worldIdx);
|
||||||
|
zeus::CTransform inv = mapuWld.GetWorldTransform().inverse();
|
||||||
|
zeus::CQuaternion invRot = zeus::CQuaternion(inv.buildMatrix3f());
|
||||||
|
xa8_renderStates[2].x8_camOrientation *= invRot;
|
||||||
|
xa8_renderStates[2].x20_areaPoint = inv * xa8_renderStates[2].x20_areaPoint;
|
||||||
|
xa8_renderStates[0].x8_camOrientation *= invRot;
|
||||||
|
xa8_renderStates[0].x20_areaPoint = inv * xa8_renderStates[0].x20_areaPoint;
|
||||||
|
xa8_renderStates[1].x8_camOrientation *= invRot;
|
||||||
|
xa8_renderStates[1].x20_areaPoint = inv * xa8_renderStates[1].x20_areaPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CAutoMapper::TransformRenderStateWorldToUniverse(SAutoMapperRenderState& state)
|
||||||
|
{
|
||||||
|
state.x20_areaPoint = x8_mapu->GetMapWorldData(x9c_worldIdx).GetWorldTransform() *
|
||||||
|
xa8_renderStates[1].x20_areaPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CAutoMapper::SetupHintNavigation()
|
||||||
|
{
|
||||||
|
if (!g_GameState->GameOptions().GetIsHintSystemEnabled())
|
||||||
|
return;
|
||||||
|
x1e0_hintSteps.clear();
|
||||||
|
x1f8_hintLocations.clear();
|
||||||
|
CHintOptions& hintOpts = g_GameState->HintOptions();
|
||||||
|
const CHintOptions::SHintState* curHint = hintOpts.GetCurrentDisplayedHint();
|
||||||
|
bool navigating = false;
|
||||||
|
if (curHint && curHint->CanContinue())
|
||||||
|
{
|
||||||
|
navigating = true;
|
||||||
|
x1e0_hintSteps.push_back({SAutoMapperHintStep::ShowBeacon{}, 0.75f});
|
||||||
|
const CGameHintInfo::CGameHint& nextHint = g_MemoryCardSys->GetHints()[hintOpts.GetNextHintIdx()];
|
||||||
|
ResId curMlvl = x24_world->IGetWorldAssetId();
|
||||||
|
for (const CGameHintInfo::SHintLocation& loc : nextHint.GetLocations())
|
||||||
|
{
|
||||||
|
if (loc.x0_mlvlId != curMlvl)
|
||||||
|
{
|
||||||
|
x1e0_hintSteps.push_back({SAutoMapperHintStep::SwitchToUniverse{}});
|
||||||
|
x1e0_hintSteps.push_back({SAutoMapperHintStep::PanToWorld{}, curMlvl});
|
||||||
|
x1e0_hintSteps.push_back({SAutoMapperHintStep::SwitchToWorld{}, curMlvl});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x1e0_hintSteps.push_back({SAutoMapperHintStep::PulseCurrentArea{}});
|
||||||
|
}
|
||||||
|
x1e0_hintSteps.push_back({SAutoMapperHintStep::PanToArea{}, loc.x8_areaId});
|
||||||
|
x1e0_hintSteps.push_back({SAutoMapperHintStep::PulseTargetArea{}});
|
||||||
|
x1e0_hintSteps.push_back({SAutoMapperHintStep::ShowBeacon{}, 1.f});
|
||||||
|
x1f8_hintLocations.push_back({0, 0.f, loc.x0_mlvlId, loc.x8_areaId});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i=0 ; i<hintOpts.GetHintStates().size() ; ++i)
|
||||||
|
{
|
||||||
|
const CHintOptions::SHintState& state = hintOpts.GetHintStates()[i];
|
||||||
|
if (navigating && hintOpts.GetNextHintIdx() == i)
|
||||||
|
continue;
|
||||||
|
if (state.x0_state != CHintOptions::EHintState::Displaying)
|
||||||
|
continue;
|
||||||
|
const CGameHintInfo::CGameHint& hint = g_MemoryCardSys->GetHints()[i];
|
||||||
|
for (const CGameHintInfo::SHintLocation& loc : hint.GetLocations())
|
||||||
|
x1f8_hintLocations.push_back({1, 1.f, loc.x0_mlvlId, loc.x8_areaId});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void CAutoMapper::OnNewInGameGuiState(EInGameGuiState state, const CStateManager& mgr)
|
||||||
|
{
|
||||||
|
if (state == EInGameGuiState::MapScreen)
|
||||||
|
{
|
||||||
|
MP1::CMain::EnsureWorldPaksReady();
|
||||||
|
const CWorld& wld = *mgr.GetWorld();
|
||||||
|
const_cast<CMapWorld*>(wld.GetMapWorld())->SetWhichMapAreasLoaded(wld, 0, 9999);
|
||||||
|
SetupHintNavigation();
|
||||||
|
BeginMapperStateTransition(EAutoMapperState::MapScreen, mgr);
|
||||||
|
x28_frmeMapScreen = g_SimplePool->GetObj("FRME_MapScreen");
|
||||||
|
SetResLockState(x210_lstick, true);
|
||||||
|
SetResLockState(x25c_cstick, true);
|
||||||
|
SetResLockState(x2a8_ltrigger, true);
|
||||||
|
SetResLockState(x2bc_rtrigger, true);
|
||||||
|
SetResLockState(x2d0_abutton, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MP1::CMain::EnsureWorldPakReady(g_GameState->CurrentWorldAssetId());
|
||||||
|
if (x1bc_state == EAutoMapperState::MapScreenUniverse || x24_world == mgr.GetWorld())
|
||||||
|
{
|
||||||
|
BeginMapperStateTransition(EAutoMapperState::MiniMap, mgr);
|
||||||
|
x328_ = 0;
|
||||||
|
}
|
||||||
|
LeaveMapScreenState();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,14 +28,24 @@ public:
|
||||||
};
|
};
|
||||||
enum class EAutoMapperState
|
enum class EAutoMapperState
|
||||||
{
|
{
|
||||||
Zero
|
MiniMap,
|
||||||
|
MapScreen,
|
||||||
|
MapScreenUniverse
|
||||||
};
|
};
|
||||||
struct SAutoMapperRenderState
|
struct SAutoMapperRenderState
|
||||||
{
|
{
|
||||||
|
enum class Ease
|
||||||
|
{
|
||||||
|
None,
|
||||||
|
Linear,
|
||||||
|
Out,
|
||||||
|
In,
|
||||||
|
InOut
|
||||||
|
};
|
||||||
zeus::CVector2i x0_viewportSize;
|
zeus::CVector2i x0_viewportSize;
|
||||||
zeus::CQuaternion x8_camOrientation;
|
zeus::CQuaternion x8_camOrientation;
|
||||||
float x18_f1;
|
float x18_camDist;
|
||||||
float x1c_f2;
|
float x1c_camAngle;
|
||||||
zeus::CVector3f x20_areaPoint;
|
zeus::CVector3f x20_areaPoint;
|
||||||
float x2c_drawDepth1;
|
float x2c_drawDepth1;
|
||||||
float x30_drawDepth2;
|
float x30_drawDepth2;
|
||||||
|
@ -43,21 +53,82 @@ public:
|
||||||
float x38_alphaOutlineVisited;
|
float x38_alphaOutlineVisited;
|
||||||
float x3c_alphaSurfaceUnvisited;
|
float x3c_alphaSurfaceUnvisited;
|
||||||
float x40_alphaOutlineUnvisited;
|
float x40_alphaOutlineUnvisited;
|
||||||
u32 x44_;
|
Ease x44_viewportEase;
|
||||||
u32 x48_;
|
Ease x48_camEase;
|
||||||
u32 x4c_;
|
Ease x4c_pointEase;
|
||||||
u32 x50_;
|
Ease x50_depth1Ease;
|
||||||
u32 x54_;
|
Ease x54_depth2Ease;
|
||||||
u32 x58_;
|
Ease x58_alphaEase;
|
||||||
SAutoMapperRenderState() = default;
|
SAutoMapperRenderState() = default;
|
||||||
SAutoMapperRenderState(const zeus::CVector2i& v1, const zeus::CQuaternion& rot,
|
SAutoMapperRenderState(const zeus::CVector2i& v1, const zeus::CQuaternion& rot,
|
||||||
float f1, float f2, const zeus::CVector3f& v2, float f3, float f4,
|
float f1, float f2, const zeus::CVector3f& v2, float f3, float f4,
|
||||||
float f5, float f6, float f7, float f8)
|
float f5, float f6, float f7, float f8)
|
||||||
: x0_viewportSize(v1), x8_camOrientation(rot), x18_f1(f1), x1c_f2(f2),
|
: x0_viewportSize(v1), x8_camOrientation(rot), x18_camDist(f1), x1c_camAngle(f2),
|
||||||
x20_areaPoint(v2), x2c_drawDepth1(f3), x30_drawDepth2(f4),
|
x20_areaPoint(v2), x2c_drawDepth1(f3), x30_drawDepth2(f4),
|
||||||
x34_alphaSurfaceVisited(f5), x38_alphaOutlineVisited(f6),
|
x34_alphaSurfaceVisited(f5), x38_alphaOutlineVisited(f6),
|
||||||
x3c_alphaSurfaceUnvisited(f7), x40_alphaOutlineUnvisited(f8),
|
x3c_alphaSurfaceUnvisited(f7), x40_alphaOutlineUnvisited(f8),
|
||||||
x44_(0), x48_(0), x4c_(0), x50_(0), x54_(0), x58_(0) {}
|
x44_viewportEase(Ease::None), x48_camEase(Ease::None), x4c_pointEase(Ease::None),
|
||||||
|
x50_depth1Ease(Ease::None), x54_depth2Ease(Ease::None), x58_alphaEase(Ease::None) {}
|
||||||
|
|
||||||
|
static void InterpolateWithClamp(const SAutoMapperRenderState& a,
|
||||||
|
SAutoMapperRenderState& out,
|
||||||
|
const SAutoMapperRenderState& b,
|
||||||
|
float t);
|
||||||
|
void ResetInterpolation()
|
||||||
|
{
|
||||||
|
x44_viewportEase = Ease::None;
|
||||||
|
x48_camEase = Ease::None;
|
||||||
|
x4c_pointEase = Ease::None;
|
||||||
|
x50_depth1Ease = Ease::None;
|
||||||
|
x54_depth2Ease = Ease::None;
|
||||||
|
x58_alphaEase = Ease::None;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct SAutoMapperHintStep
|
||||||
|
{
|
||||||
|
enum class Type
|
||||||
|
{
|
||||||
|
PanToArea,
|
||||||
|
PanToWorld,
|
||||||
|
SwitchToUniverse,
|
||||||
|
SwitchToWorld,
|
||||||
|
ShowBeacon,
|
||||||
|
PulseTargetArea,
|
||||||
|
PulseCurrentArea
|
||||||
|
};
|
||||||
|
struct PanToArea {};
|
||||||
|
struct PanToWorld {};
|
||||||
|
struct SwitchToUniverse {};
|
||||||
|
struct SwitchToWorld {};
|
||||||
|
struct ShowBeacon {};
|
||||||
|
struct PulseTargetArea {};
|
||||||
|
struct PulseCurrentArea {};
|
||||||
|
|
||||||
|
Type x0_type;
|
||||||
|
union
|
||||||
|
{
|
||||||
|
ResId x4_worldId;
|
||||||
|
TAreaId x4_areaId;
|
||||||
|
float x4_float;
|
||||||
|
};
|
||||||
|
bool x8_ = false;
|
||||||
|
|
||||||
|
SAutoMapperHintStep(PanToArea, TAreaId areaId) : x0_type(Type::PanToArea), x4_areaId(areaId) {}
|
||||||
|
SAutoMapperHintStep(PanToWorld, ResId worldId) : x0_type(Type::PanToWorld), x4_worldId(worldId) {}
|
||||||
|
SAutoMapperHintStep(SwitchToUniverse) : x0_type(Type::SwitchToUniverse), x4_worldId(0) {}
|
||||||
|
SAutoMapperHintStep(SwitchToWorld, ResId worldId) : x0_type(Type::SwitchToWorld), x4_worldId(worldId) {}
|
||||||
|
SAutoMapperHintStep(ShowBeacon, float val) : x0_type(Type::ShowBeacon), x4_float(val) {}
|
||||||
|
SAutoMapperHintStep(PulseTargetArea) : x0_type(Type::PulseTargetArea), x4_worldId(0) {}
|
||||||
|
SAutoMapperHintStep(PulseCurrentArea) : x0_type(Type::PulseCurrentArea), x4_worldId(0) {}
|
||||||
|
};
|
||||||
|
|
||||||
|
struct SAutoMapperHintLocation
|
||||||
|
{
|
||||||
|
u32 x0_;
|
||||||
|
float x4_;
|
||||||
|
ResId x8_worldId;
|
||||||
|
TAreaId xc_areaId;
|
||||||
};
|
};
|
||||||
|
|
||||||
class CAudioMenu
|
class CAudioMenu
|
||||||
|
@ -86,11 +157,18 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
enum class EZoomState
|
||||||
|
{
|
||||||
|
None,
|
||||||
|
In,
|
||||||
|
Out
|
||||||
|
};
|
||||||
|
|
||||||
ELoadPhase x4_loadPhase = ELoadPhase::LoadResources;
|
ELoadPhase x4_loadPhase = ELoadPhase::LoadResources;
|
||||||
TLockedToken<CMapUniverse> x8_mapu;
|
TLockedToken<CMapUniverse> x8_mapu;
|
||||||
std::vector<std::unique_ptr<IWorld>> x14_dummyWorlds;
|
std::vector<std::unique_ptr<IWorld>> x14_dummyWorlds;
|
||||||
CWorld& x24_world;
|
const CWorld* x24_world;
|
||||||
u32 x28_ = 0;
|
TLockedToken<CModel> x28_frmeMapScreen; // Used to be ptr
|
||||||
u32 x2c_ = 0;
|
u32 x2c_ = 0;
|
||||||
TLockedToken<CModel> x30_miniMapSamus;
|
TLockedToken<CModel> x30_miniMapSamus;
|
||||||
TLockedToken<CTexture> x3c_hintBeacon;
|
TLockedToken<CTexture> x3c_hintBeacon;
|
||||||
|
@ -102,27 +180,25 @@ private:
|
||||||
u32 x9c_worldIdx = 0;
|
u32 x9c_worldIdx = 0;
|
||||||
TAreaId xa0_curAreaId;
|
TAreaId xa0_curAreaId;
|
||||||
TAreaId xa4_otherAreaId;
|
TAreaId xa4_otherAreaId;
|
||||||
SAutoMapperRenderState xa8_[3]; // xa8, x104, x160
|
SAutoMapperRenderState xa8_renderStates[3]; // xa8, x104, x160; current, prev, next
|
||||||
EAutoMapperState x1bc_state = EAutoMapperState::Zero;
|
EAutoMapperState x1bc_state = EAutoMapperState::MiniMap;
|
||||||
EAutoMapperState x1c0_nextState = EAutoMapperState::Zero;
|
EAutoMapperState x1c0_nextState = EAutoMapperState::MiniMap;
|
||||||
float x1c4_ = 0.f;
|
float x1c4_ = 0.f;
|
||||||
float x1c8_ = 0.f;
|
float x1c8_ = 0.f;
|
||||||
u32 x1cc_ = 0;
|
CSfxHandle x1cc_panningSfx;
|
||||||
u32 x1d0_ = 0;
|
CSfxHandle x1d0_rotatingSfx;
|
||||||
u32 x1d4_ = 0;
|
CSfxHandle x1d4_zoomingSfx;
|
||||||
float x1d8_ = 0.f;
|
float x1d8_ = 0.f;
|
||||||
float x1dc_ = 0.f;
|
float x1dc_ = 0.f;
|
||||||
std::list<u32> x1e0_;
|
std::list<SAutoMapperHintStep> x1e0_hintSteps;
|
||||||
u32 x1f4_ = 0;
|
std::list<SAutoMapperHintLocation> x1f8_hintLocations;
|
||||||
std::list<u32> x1f8_;
|
|
||||||
u32 x20c_ = 0;
|
|
||||||
rstl::reserved_vector<TLockedToken<CTexture>, 9> x210_lstick;
|
rstl::reserved_vector<TLockedToken<CTexture>, 9> x210_lstick;
|
||||||
rstl::reserved_vector<TLockedToken<CTexture>, 9> x25c_cstick;
|
rstl::reserved_vector<TLockedToken<CTexture>, 9> x25c_cstick;
|
||||||
rstl::reserved_vector<TLockedToken<CTexture>, 2> x2a8_ltrigger;
|
rstl::reserved_vector<TLockedToken<CTexture>, 2> x2a8_ltrigger;
|
||||||
rstl::reserved_vector<TLockedToken<CTexture>, 2> x2bc_rtrigger;
|
rstl::reserved_vector<TLockedToken<CTexture>, 2> x2bc_rtrigger;
|
||||||
rstl::reserved_vector<TLockedToken<CTexture>, 2> x2d0_abutton;
|
rstl::reserved_vector<TLockedToken<CTexture>, 2> x2d0_abutton;
|
||||||
u32 x2e4_ = 0;
|
u32 x2e4_lStickPos = 0;
|
||||||
u32 x2e8_ = 0;
|
u32 x2e8_rStickPos = 0;
|
||||||
u32 x2ec_ = 0;
|
u32 x2ec_ = 0;
|
||||||
u32 x2f0_ = 0;
|
u32 x2f0_ = 0;
|
||||||
u32 x2f4_ = 0;
|
u32 x2f4_ = 0;
|
||||||
|
@ -137,14 +213,51 @@ private:
|
||||||
float x318_ = 0.f;
|
float x318_ = 0.f;
|
||||||
float x31c_ = 0.f;
|
float x31c_ = 0.f;
|
||||||
float x320_ = 0.f;
|
float x320_ = 0.f;
|
||||||
u32 x324_ = 0;
|
EZoomState x324_zoomState = EZoomState::None;
|
||||||
u32 x328_ = 0;
|
u32 x328_ = 0;
|
||||||
u32 x32c_ = 0;
|
bool x32c_loadingDummyWorld = false;
|
||||||
|
|
||||||
|
template <class T>
|
||||||
|
static void SetResLockState(T& list, bool lock)
|
||||||
|
{
|
||||||
|
for (auto& res : list)
|
||||||
|
if (lock)
|
||||||
|
res.Lock();
|
||||||
|
else
|
||||||
|
res.Unlock();
|
||||||
|
}
|
||||||
|
bool NotHintNavigating() const;
|
||||||
|
bool CanLeaveMapScreenInternal(const CStateManager& mgr) const;
|
||||||
|
bool HasCurrentMapUniverseWorld() const;
|
||||||
|
bool CheckDummyWorldLoad(const CStateManager& mgr);
|
||||||
|
void UpdateHintNavigation(float dt, const CStateManager& mgr);
|
||||||
|
static zeus::CVector2i GetMiniMapViewportSize();
|
||||||
|
static zeus::CVector2i GetMapScreenViewportSize();
|
||||||
|
static float GetMapAreaMiniMapDrawDepth() { return 2.f; }
|
||||||
|
float GetMapAreaMaxDrawDepth(const CStateManager&, TAreaId) const;
|
||||||
|
static float GetMapAreaMiniMapDrawAlphaSurfaceVisited(const CStateManager&);
|
||||||
|
static float GetMapAreaMiniMapDrawAlphaOutlineVisited(const CStateManager&);
|
||||||
|
static float GetMapAreaMiniMapDrawAlphaSurfaceUnvisited(const CStateManager&);
|
||||||
|
static float GetMapAreaMiniMapDrawAlphaOutlineUnvisited(const CStateManager&);
|
||||||
|
static void GetDesiredMiniMapCameraDistance(const CStateManager&);
|
||||||
|
static float GetBaseMapScreenCameraMoveSpeed();
|
||||||
|
float GetClampedMapScreenCameraDistance(float);
|
||||||
|
float GetFinalMapScreenCameraMoveSpeed() const;
|
||||||
|
void ProcessMapRotateInput(const CFinalInput& input, const CStateManager& mgr);
|
||||||
|
void ProcessMapZoomInput(const CFinalInput& input, const CStateManager& mgr);
|
||||||
|
void ProcessMapPanInput(const CFinalInput& input, const CStateManager& mgr);
|
||||||
|
void SetShouldPanningSoundBePlaying(bool);
|
||||||
|
void SetShouldZoomingSoundBePlaying(bool);
|
||||||
|
void SetShouldRotatingSoundBePlaying(bool);
|
||||||
|
void TransformRenderStatesWorldToUniverse();
|
||||||
|
void TransformRenderStatesUniverseToWorld();
|
||||||
|
void TransformRenderStateWorldToUniverse(SAutoMapperRenderState&);
|
||||||
|
void SetupHintNavigation();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CAutoMapper(CStateManager& stateMgr);
|
CAutoMapper(CStateManager& stateMgr);
|
||||||
bool CheckLoadComplete();
|
bool CheckLoadComplete();
|
||||||
bool CanLeaveMapScrean(const CStateManager&) const;
|
bool CanLeaveMapScreen(const CStateManager&) const;
|
||||||
float GetMapRotationX() const;
|
float GetMapRotationX() const;
|
||||||
float GetMapRotationZ() const;
|
float GetMapRotationZ() const;
|
||||||
u32 GetFocusAreaIndex() const;
|
u32 GetFocusAreaIndex() const;
|
||||||
|
@ -162,40 +275,29 @@ public:
|
||||||
void CompleteMapperStateTransition();
|
void CompleteMapperStateTransition();
|
||||||
void ResetInterpolationTimer(float);
|
void ResetInterpolationTimer(float);
|
||||||
SAutoMapperRenderState BuildMiniMapWorldRenderState(const CStateManager&, const zeus::CQuaternion&, TAreaId) const;
|
SAutoMapperRenderState BuildMiniMapWorldRenderState(const CStateManager&, const zeus::CQuaternion&, TAreaId) const;
|
||||||
SAutoMapperRenderState BuildMapScreenWorldRenderState(const CStateManager&, const zeus::CQuaternion&, TAreaId) const;
|
SAutoMapperRenderState BuildMapScreenWorldRenderState(const CStateManager&, const zeus::CQuaternion&, TAreaId, bool) const;
|
||||||
SAutoMapperRenderState BuildMapScreenUniverseRenderState(const CStateManager&, const zeus::CQuaternion&, TAreaId) const;
|
SAutoMapperRenderState BuildMapScreenUniverseRenderState(const CStateManager&, const zeus::CQuaternion&, TAreaId) const;
|
||||||
void SetShouldPanningSoundBePlaying(bool);
|
|
||||||
void SetShouldZoomingSoundBePlaying(bool);
|
|
||||||
void SetShouldRotatingSoundBePlaying(bool);
|
|
||||||
void LeaveMapScreenState();
|
void LeaveMapScreenState();
|
||||||
|
void ProcessMapScreenInput(const CFinalInput& input, const CStateManager& mgr);
|
||||||
zeus::CQuaternion GetMiniMapCameraOrientation(const CStateManager&) const;
|
zeus::CQuaternion GetMiniMapCameraOrientation(const CStateManager&) const;
|
||||||
zeus::CVector3f GetAreaPointOfInterest(const CStateManager&, TAreaId) const;
|
zeus::CVector3f GetAreaPointOfInterest(const CStateManager&, TAreaId) const;
|
||||||
void FindClosestVisibleArea(const zeus::CVector3f&, const zeus::CUnitVector3f&, const CStateManager&,
|
TAreaId FindClosestVisibleArea(const zeus::CVector3f&, const zeus::CUnitVector3f&, const CStateManager&,
|
||||||
const IWorld&, const CMapWorldInfo&) const;
|
const IWorld&, const CMapWorldInfo&) const;
|
||||||
void FindClosestVisibleWorld(const zeus::CVector3f&, const zeus::CUnitVector3f&, const CStateManager&) const;
|
std::pair<TAreaId, int>
|
||||||
|
FindClosestVisibleWorld(const zeus::CVector3f&, const zeus::CUnitVector3f&, const CStateManager&) const;
|
||||||
static zeus::CVector2i GetMiniMapViewportSize();
|
|
||||||
static void GetMapScreenViewportSize();
|
|
||||||
static float GetMapAreaMiniMapDrawDepth() { return 2.f; }
|
|
||||||
static float GetMapAreaMaxDrawDepth();
|
|
||||||
static float GetMapAreaMiniMapDrawAlphaSurfaceVisited(const CStateManager&);
|
|
||||||
static float GetMapAreaMiniMapDrawAlphaOutlineVisited(const CStateManager&);
|
|
||||||
static float GetMapAreaMiniMapDrawAlphaSurfaceUnvisited(const CStateManager&);
|
|
||||||
static float GetMapAreaMiniMapDrawAlphaOutlineUnvisited(const CStateManager&);
|
|
||||||
static void GetClampedMapScreenCameraDistance(float);
|
|
||||||
static void GetDesiredMiniMapCameraDistance(const CStateManager&);
|
|
||||||
static float GetBaseCameraMoveSpeed();
|
|
||||||
static float GetFinalCameraMoveSpeed();
|
|
||||||
|
|
||||||
bool IsInMapperState(EAutoMapperState state) const
|
bool IsInMapperState(EAutoMapperState state) const
|
||||||
{
|
{
|
||||||
return state == x1bc_state && state == x1c0_nextState;
|
return state == x1bc_state && state == x1c0_nextState;
|
||||||
}
|
}
|
||||||
bool IsInMapperTransition() const;
|
bool IsInMapperStateTransition() const
|
||||||
bool IsRenderStateInterpolating() const;
|
{
|
||||||
void TransformRenderStatesWorldToUniverse();
|
return x1c0_nextState != x1bc_state;
|
||||||
void TransformRenderStatesUniverseToWorld();
|
}
|
||||||
void TransformRenderStateWorldToUniverse(SAutoMapperRenderState&);
|
bool IsRenderStateInterpolating() const
|
||||||
|
{
|
||||||
|
return x1c8_ < x1c4_;
|
||||||
|
}
|
||||||
void UpdateOptionsMenu(const CTweakValue::Audio&);
|
void UpdateOptionsMenu(const CTweakValue::Audio&);
|
||||||
void UpdateAudioMusicMenu();
|
void UpdateAudioMusicMenu();
|
||||||
void UpdateAudioEvents();
|
void UpdateAudioEvents();
|
||||||
|
|
|
@ -21,11 +21,11 @@ CMapUniverse::CMapWorldData::CMapWorldData(CInputStream& in, u32 version)
|
||||||
{
|
{
|
||||||
x14_transform.read34RowMajor(in);
|
x14_transform.read34RowMajor(in);
|
||||||
u32 worldCount = in.readUint32Big();
|
u32 worldCount = in.readUint32Big();
|
||||||
x44_areaData.reserve(worldCount);
|
x44_hexagonXfs.reserve(worldCount);
|
||||||
for (u32 i = 0 ; i<worldCount ; ++i)
|
for (u32 i = 0 ; i<worldCount ; ++i)
|
||||||
{
|
{
|
||||||
x44_areaData.emplace_back();
|
x44_hexagonXfs.emplace_back();
|
||||||
x44_areaData.back().read34RowMajor(in);
|
x44_hexagonXfs.back().read34RowMajor(in);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (version != 0)
|
if (version != 0)
|
||||||
|
@ -37,10 +37,10 @@ CMapUniverse::CMapWorldData::CMapWorldData(CInputStream& in, u32 version)
|
||||||
x5c_ = zeus::CColor::lerp(zeus::CColor::skBlack, x54_, 0.5f);
|
x5c_ = zeus::CColor::lerp(zeus::CColor::skBlack, x54_, 0.5f);
|
||||||
x60_ = zeus::CColor::lerp(zeus::CColor::skWhite, x5c_, 0.5f);
|
x60_ = zeus::CColor::lerp(zeus::CColor::skWhite, x5c_, 0.5f);
|
||||||
|
|
||||||
for (const zeus::CTransform& xf : x44_areaData)
|
for (const zeus::CTransform& xf : x44_hexagonXfs)
|
||||||
x64_ += xf.origin;
|
x64_centerPoint += xf.origin;
|
||||||
|
|
||||||
x64_ *= 1.0f / float(x44_areaData.size());
|
x64_centerPoint *= 1.0f / float(x44_hexagonXfs.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
CFactoryFnReturn FMapUniverseFactory(const SObjectTag&, CInputStream& in, const CVParamTransfer&,
|
CFactoryFnReturn FMapUniverseFactory(const SObjectTag&, CInputStream& in, const CVParamTransfer&,
|
||||||
|
|
|
@ -43,19 +43,19 @@ public:
|
||||||
std::string x0_label;
|
std::string x0_label;
|
||||||
ResId x10_worldAssetId;
|
ResId x10_worldAssetId;
|
||||||
zeus::CTransform x14_transform;
|
zeus::CTransform x14_transform;
|
||||||
std::vector<zeus::CTransform> x44_areaData;
|
std::vector<zeus::CTransform> x44_hexagonXfs;
|
||||||
zeus::CColor x54_;
|
zeus::CColor x54_;
|
||||||
zeus::CColor x58_ = zeus::CColor(1.0f, 0.0f, 1.0f);
|
zeus::CColor x58_ = zeus::CColor(1.0f, 0.0f, 1.0f);
|
||||||
zeus::CColor x5c_ = zeus::CColor(1.0f, 0.0f, 1.0f);
|
zeus::CColor x5c_ = zeus::CColor(1.0f, 0.0f, 1.0f);
|
||||||
zeus::CColor x60_ = zeus::CColor(1.0f, 0.0f, 1.0f);
|
zeus::CColor x60_ = zeus::CColor(1.0f, 0.0f, 1.0f);
|
||||||
zeus::CVector3f x64_ = zeus::CVector3f::skZero;
|
zeus::CVector3f x64_centerPoint = zeus::CVector3f::skZero;
|
||||||
public:
|
public:
|
||||||
CMapWorldData(CInputStream& in, u32 version);
|
CMapWorldData(CInputStream& in, u32 version);
|
||||||
ResId GetWorldAssetId() const { return x10_worldAssetId; }
|
ResId GetWorldAssetId() const { return x10_worldAssetId; }
|
||||||
zeus::CVector3f GetWorldCenterPoint() const;
|
const zeus::CVector3f& GetWorldCenterPoint() const { return x64_centerPoint; }
|
||||||
std::string GetWorldLabel() const;
|
const std::string& GetWorldLabel() const { return x0_label; }
|
||||||
zeus::CTransform GetWorldTransform() const;
|
const zeus::CTransform& GetWorldTransform() const { return x14_transform; }
|
||||||
void GetMapAreaData(s32) const;
|
const zeus::CTransform& GetMapAreaData(s32 idx) const { return x44_hexagonXfs[idx]; }
|
||||||
zeus::CColor GetOutlineColorUnselected() const;
|
zeus::CColor GetOutlineColorUnselected() const;
|
||||||
zeus::CColor GetOutlineColorSelected() const;
|
zeus::CColor GetOutlineColorSelected() const;
|
||||||
zeus::CColor GetSurfaceColorUnselected() const;
|
zeus::CColor GetSurfaceColorUnselected() const;
|
||||||
|
@ -67,14 +67,17 @@ private:
|
||||||
ResId x0_hexagonId;
|
ResId x0_hexagonId;
|
||||||
TLockedToken<CMapArea> x4_hexagonToken;
|
TLockedToken<CMapArea> x4_hexagonToken;
|
||||||
std::vector<CMapWorldData> x10_worldDatas;
|
std::vector<CMapWorldData> x10_worldDatas;
|
||||||
zeus::CVector3f x20_ = zeus::CVector3f::skZero;
|
zeus::CVector3f x20_universeCenter = zeus::CVector3f::skZero;
|
||||||
|
float x2c_universeRadius = 1600.f;
|
||||||
public:
|
public:
|
||||||
CMapUniverse(CInputStream&, u32);
|
CMapUniverse(CInputStream&, u32);
|
||||||
const CMapWorldData& GetMapWorldData(s32 idx) const { return x10_worldDatas[idx]; }
|
const CMapWorldData& GetMapWorldData(s32 idx) const { return x10_worldDatas[idx]; }
|
||||||
u32 GetNumMapWorldDatas() const { return x10_worldDatas.size(); }
|
u32 GetNumMapWorldDatas() const { return x10_worldDatas.size(); }
|
||||||
float GetMapUniverseRadius() const;
|
float GetMapUniverseRadius() const { return x2c_universeRadius; }
|
||||||
zeus::CVector3f GetMapUniverseCenterPoint() const;
|
const zeus::CVector3f& GetMapUniverseCenterPoint() const { return x20_universeCenter; }
|
||||||
void Draw(const CMapUniverseDrawParms&, const zeus::CVector3f&, float, float) const;
|
void Draw(const CMapUniverseDrawParms&, const zeus::CVector3f&, float, float) const;
|
||||||
|
std::vector<CMapWorldData>::const_iterator begin() const { return x10_worldDatas.cbegin(); }
|
||||||
|
std::vector<CMapWorldData>::const_iterator end() const { return x10_worldDatas.cend(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
CFactoryFnReturn FMapUniverseFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms,
|
CFactoryFnReturn FMapUniverseFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms,
|
||||||
|
|
|
@ -7,22 +7,12 @@ CMapWorld::CMapWorld(CInputStream& in)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 CMapWorld::GetNumAreas() const
|
void CMapWorld::IsMapAreaInBFSInfoVector(const CMapWorld::CMapAreaData*, const std::vector<CMapWorld::CMapAreaBFSInfo>&) const
|
||||||
{
|
|
||||||
return x0_areas.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
const CMapArea* CMapWorld::GetMapArea(TAreaId aid) const
|
|
||||||
{
|
|
||||||
return x0_areas[aid].GetMapArea();
|
|
||||||
}
|
|
||||||
|
|
||||||
void CMapWorld::IsMapAreaInBFSInfoVector(const CMapWorld::CMapAreaData *, const std::vector<CMapWorld::CMapAreaBFSInfo> &) const
|
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMapWorld::SetWhichMapAreasLoaded(const IWorld &, int start, int count)
|
void CMapWorld::SetWhichMapAreasLoaded(const IWorld&, int start, int count)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -32,27 +22,33 @@ bool CMapWorld::IsMapAreasStreaming() const
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMapWorld::MoveMapAreaToList(CMapWorld::CMapAreaData *, CMapWorld::EMapAreaList)
|
void CMapWorld::MoveMapAreaToList(CMapWorld::CMapAreaData*, CMapWorld::EMapAreaList)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMapWorld::GetCurrentMapAreaDepth(const IWorld &, int) const
|
s32 CMapWorld::GetCurrentMapAreaDepth(const IWorld& wld, TAreaId aid) const
|
||||||
|
{
|
||||||
|
ClearTraversedFlags();
|
||||||
|
std::vector<CMapAreaBFSInfo> info;
|
||||||
|
info.reserve(x0_areas.size());
|
||||||
|
DoBFS(wld, aid, 9999, 9999.f, 9999.f, false, info);
|
||||||
|
if (info.empty())
|
||||||
|
return 0;
|
||||||
|
return info.back().GetDepth();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CMapWorld::GetVisibleAreas(const IWorld&, const CMapWorldInfo&) const
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMapWorld::GetVisibleAreas(const IWorld &, const CMapWorldInfo &) const
|
void CMapWorld::Draw(const CMapWorld::CMapWorldDrawParms&, int, int, float, float, bool) const
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMapWorld::Draw(const CMapWorld::CMapWorldDrawParms &, int, int, float, float, bool) const
|
void CMapWorld::DoBFS(const IWorld&, TAreaId, int, float, float, bool, std::vector<CMapAreaBFSInfo>&) const
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void CMapWorld::DoBFS(const IWorld &, int, int, float, float, bool, std::vector<CMapWorld::CMapAreaBFSInfo> &) const
|
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -62,19 +58,19 @@ bool CMapWorld::IsMapAreaValid(const IWorld &, int, bool) const
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMapWorld::DrawAreas(const CMapWorld::CMapWorldDrawParms &, int, const std::vector<CMapWorld::CMapAreaBFSInfo> &, bool) const
|
void CMapWorld::DrawAreas(const CMapWorld::CMapWorldDrawParms&, int, const std::vector<CMapWorld::CMapAreaBFSInfo>&, bool) const
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMapWorld::RecalculateWorldSphere(const CMapWorldInfo &, const IWorld &) const
|
void CMapWorld::RecalculateWorldSphere(const CMapWorldInfo&, const IWorld&) const
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMapWorld::ConstrainToWorldVolume(const zeus::CVector3f &, const zeus::CVector3f &) const
|
zeus::CVector3f CMapWorld::ConstrainToWorldVolume(const zeus::CVector3f&, const zeus::CVector3f&) const
|
||||||
{
|
{
|
||||||
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMapWorld::ClearTraversedFlags() const
|
void CMapWorld::ClearTraversedFlags() const
|
||||||
|
|
|
@ -23,10 +23,15 @@ public:
|
||||||
|
|
||||||
class CMapAreaBFSInfo
|
class CMapAreaBFSInfo
|
||||||
{
|
{
|
||||||
|
s32 x0_areaIdx;
|
||||||
|
s32 x4_depth;
|
||||||
|
float x8_;
|
||||||
|
float xc_;
|
||||||
public:
|
public:
|
||||||
CMapAreaBFSInfo(s32, s32, float, float);
|
CMapAreaBFSInfo(s32 areaIdx, s32 depth, float a, float b)
|
||||||
u32 GetAreaIndex() const;
|
: x0_areaIdx(areaIdx), x4_depth(depth), x8_(a), xc_(b) {}
|
||||||
float GetDepth();
|
s32 GetAreaIndex() const { return x0_areaIdx; }
|
||||||
|
s32 GetDepth() const { return x4_depth; }
|
||||||
float GetOutlineDrawDepth() const;
|
float GetOutlineDrawDepth() const;
|
||||||
float GetSurfaceDrawDepth() const;
|
float GetSurfaceDrawDepth() const;
|
||||||
};
|
};
|
||||||
|
@ -87,20 +92,20 @@ private:
|
||||||
std::vector<CMapAreaData> x0_areas;
|
std::vector<CMapAreaData> x0_areas;
|
||||||
public:
|
public:
|
||||||
CMapWorld(CInputStream&);
|
CMapWorld(CInputStream&);
|
||||||
u32 GetNumAreas() const;
|
u32 GetNumAreas() const { return x0_areas.size(); }
|
||||||
const CMapArea* GetMapArea(TAreaId) const;
|
const CMapArea* GetMapArea(TAreaId aid) const { return x0_areas[aid].GetMapArea(); }
|
||||||
void IsMapAreaInBFSInfoVector(const CMapAreaData*, const std::vector<CMapAreaBFSInfo>&) const;
|
void IsMapAreaInBFSInfoVector(const CMapAreaData*, const std::vector<CMapAreaBFSInfo>&) const;
|
||||||
void SetWhichMapAreasLoaded(const IWorld&, int start, int count);
|
void SetWhichMapAreasLoaded(const IWorld&, int start, int count);
|
||||||
bool IsMapAreasStreaming() const;
|
bool IsMapAreasStreaming() const;
|
||||||
void MoveMapAreaToList(CMapAreaData*, EMapAreaList);
|
void MoveMapAreaToList(CMapAreaData*, EMapAreaList);
|
||||||
void GetCurrentMapAreaDepth(const IWorld&, int) const;
|
s32 GetCurrentMapAreaDepth(const IWorld&, TAreaId) const;
|
||||||
void GetVisibleAreas(const IWorld&, const CMapWorldInfo&) const;
|
void GetVisibleAreas(const IWorld&, const CMapWorldInfo&) const;
|
||||||
void Draw(const CMapWorldDrawParms&, int, int, float, float, bool) const;
|
void Draw(const CMapWorldDrawParms&, int, int, float, float, bool) const;
|
||||||
void DoBFS(const IWorld&, int, int, float, float, bool, std::vector<CMapAreaBFSInfo>&) const;
|
void DoBFS(const IWorld&, TAreaId, int, float, float, bool, std::vector<CMapAreaBFSInfo>&) const;
|
||||||
bool IsMapAreaValid(const IWorld&, int, bool) const;
|
bool IsMapAreaValid(const IWorld&, int, bool) const;
|
||||||
void DrawAreas(const CMapWorldDrawParms&, int, const std::vector<CMapAreaBFSInfo>&, bool) const;
|
void DrawAreas(const CMapWorldDrawParms&, int, const std::vector<CMapAreaBFSInfo>&, bool) const;
|
||||||
void RecalculateWorldSphere(const CMapWorldInfo&, const IWorld&) const;
|
void RecalculateWorldSphere(const CMapWorldInfo&, const IWorld&) const;
|
||||||
void ConstrainToWorldVolume(const zeus::CVector3f&, const zeus::CVector3f&) const;
|
zeus::CVector3f ConstrainToWorldVolume(const zeus::CVector3f&, const zeus::CVector3f&) const;
|
||||||
void ClearTraversedFlags() const;
|
void ClearTraversedFlags() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -218,6 +218,7 @@ public:
|
||||||
void ActivateContinueDelayHintTimer(const char* name);
|
void ActivateContinueDelayHintTimer(const char* name);
|
||||||
void DismissDisplayedHint();
|
void DismissDisplayedHint();
|
||||||
u32 GetNextHintIdx() const;
|
u32 GetNextHintIdx() const;
|
||||||
|
const std::vector<SHintState>& GetHintStates() const { return x0_hintStates; }
|
||||||
void Update(float dt, const CStateManager& stateMgr);
|
void Update(float dt, const CStateManager& stateMgr);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include "CMemoryCardSys.hpp"
|
#include "CMemoryCardSys.hpp"
|
||||||
#include "CSimplePool.hpp"
|
#include "CSimplePool.hpp"
|
||||||
#include "CSaveWorld.hpp"
|
#include "CSaveWorld.hpp"
|
||||||
|
#include "MP1/MP1.hpp"
|
||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
|
@ -164,7 +165,7 @@ CGameState::CGameState(CBitStreamReader& stream, u32 saveIdx)
|
||||||
x228_24_hardMode = stream.ReadEncoded(1);
|
x228_24_hardMode = stream.ReadEncoded(1);
|
||||||
x228_25_deferPowerupInit = stream.ReadEncoded(1);
|
x228_25_deferPowerupInit = stream.ReadEncoded(1);
|
||||||
x84_mlvlId = g_ResFactory->TranslateOriginalToNew(stream.ReadEncoded(32));
|
x84_mlvlId = g_ResFactory->TranslateOriginalToNew(stream.ReadEncoded(32));
|
||||||
EnsureWorldPakReady(x84_mlvlId);
|
MP1::CMain::EnsureWorldPakReady(x84_mlvlId);
|
||||||
|
|
||||||
BitsToDouble conv;
|
BitsToDouble conv;
|
||||||
conv.low = stream.ReadEncoded(32);
|
conv.low = stream.ReadEncoded(32);
|
||||||
|
@ -256,16 +257,11 @@ void CGameState::PutTo(CBitStreamWriter& writer) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGameState::EnsureWorldPakReady(ResId mlvl)
|
|
||||||
{
|
|
||||||
/* TODO: Schedule resource list load for World Pak containing mlvl */
|
|
||||||
}
|
|
||||||
|
|
||||||
void CGameState::SetCurrentWorldId(ResId id)
|
void CGameState::SetCurrentWorldId(ResId id)
|
||||||
{
|
{
|
||||||
StateForWorld(id);
|
StateForWorld(id);
|
||||||
x84_mlvlId = id;
|
x84_mlvlId = id;
|
||||||
EnsureWorldPakReady(x84_mlvlId);
|
MP1::CMain::EnsureWorldPakReady(x84_mlvlId);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CGameState::SetTotalPlayTime(float time)
|
void CGameState::SetTotalPlayTime(float time)
|
||||||
|
|
|
@ -93,8 +93,6 @@ class CGameState
|
||||||
u8 _dummy = 0;
|
u8 _dummy = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void EnsureWorldPakReady(ResId mlvl);
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CGameState();
|
CGameState();
|
||||||
CGameState(CBitStreamReader& stream, u32 saveIdx);
|
CGameState(CBitStreamReader& stream, u32 saveIdx);
|
||||||
|
|
|
@ -3,16 +3,16 @@
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
|
|
||||||
CPakFile::CPakFile(const std::string& filename, bool samusPak, bool worldPak)
|
CPakFile::CPakFile(const std::string& filename, bool buildDepList, bool worldPak)
|
||||||
: CDvdFile(filename.c_str())
|
: CDvdFile(filename.c_str())
|
||||||
{
|
{
|
||||||
x28_24_samusPak = samusPak;
|
x28_24_buildDepList = buildDepList;
|
||||||
x28_26_worldPak = worldPak;
|
x28_26_worldPak = worldPak;
|
||||||
}
|
}
|
||||||
|
|
||||||
const SObjectTag* CPakFile::GetResIdByName(const char* name) const
|
const SObjectTag* CPakFile::GetResIdByName(const char* name) const
|
||||||
{
|
{
|
||||||
for (const std::pair<std::string, SObjectTag>& p : x4c_nameList)
|
for (const std::pair<std::string, SObjectTag>& p : x54_nameList)
|
||||||
if (!CStringExtras::CompareCaseInsensitive(p.first.c_str(), name))
|
if (!CStringExtras::CompareCaseInsensitive(p.first.c_str(), name))
|
||||||
return &p.second;
|
return &p.second;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -22,7 +22,7 @@ void CPakFile::AsyncIdle()
|
||||||
{
|
{
|
||||||
if (x2c_asyncLoadPhase == EAsyncPhase::Loaded)
|
if (x2c_asyncLoadPhase == EAsyncPhase::Loaded)
|
||||||
return;
|
return;
|
||||||
if (x34_dvdReq && x34_dvdReq->IsComplete())
|
if (x30_dvdReq && x30_dvdReq->IsComplete())
|
||||||
return;
|
return;
|
||||||
switch (x2c_asyncLoadPhase)
|
switch (x2c_asyncLoadPhase)
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,7 +26,7 @@ private:
|
||||||
{
|
{
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
bool x28_24_samusPak;
|
bool x28_24_buildDepList;
|
||||||
bool x28_25_aramFile;
|
bool x28_25_aramFile;
|
||||||
bool x28_26_worldPak;
|
bool x28_26_worldPak;
|
||||||
bool x28_27_worldPakInitialized;
|
bool x28_27_worldPakInitialized;
|
||||||
|
@ -40,13 +40,17 @@ private:
|
||||||
DataLoad = 2,
|
DataLoad = 2,
|
||||||
Loaded = 3
|
Loaded = 3
|
||||||
} x2c_asyncLoadPhase;
|
} x2c_asyncLoadPhase;
|
||||||
IDvdRequest* x34_dvdReq;
|
std::shared_ptr<IDvdRequest> x30_dvdReq; // Used to be auto_ptr
|
||||||
std::vector<std::pair<std::string, SObjectTag>> x4c_nameList;
|
std::vector<u8> x38_headerData;
|
||||||
std::vector<u32> x5c_depList;
|
u32 x48_resTableOffset = 0;
|
||||||
std::vector<std::pair<u32, SResInfo>> x6c_resList;
|
u32 x4c_resTableCount = 0;
|
||||||
|
int x50_ = -1;
|
||||||
|
std::vector<std::pair<std::string, SObjectTag>> x54_nameList;
|
||||||
|
std::vector<ResId> x64_depList;
|
||||||
|
std::vector<std::pair<u32, SResInfo>> x74_resList;
|
||||||
public:
|
public:
|
||||||
CPakFile(const std::string& filename, bool samusPak, bool worldPak);
|
CPakFile(const std::string& filename, bool buildDepList, bool worldPak);
|
||||||
const std::vector<u32>& GetDepList() const { return x5c_depList; }
|
const std::vector<ResId>& GetDepList() const { return x64_depList; }
|
||||||
const SObjectTag* GetResIdByName(const char* name) const;
|
const SObjectTag* GetResIdByName(const char* name) const;
|
||||||
const SResInfo* GetResInfoForLoad(u32 id) { return nullptr; }
|
const SResInfo* GetResInfoForLoad(u32 id) { return nullptr; }
|
||||||
const SResInfo* GetResInfo(u32 id) const { return nullptr; }
|
const SResInfo* GetResInfo(u32 id) const { return nullptr; }
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
|
|
||||||
const std::vector<u32>* CResLoader::GetTagListForFile(const std::string& name) const
|
const std::vector<ResId>* CResLoader::GetTagListForFile(const std::string& name) const
|
||||||
{
|
{
|
||||||
std::string namePak = name + ".pak";
|
std::string namePak = name + ".pak";
|
||||||
for (const std::unique_ptr<CPakFile>& pak : x18_pakLoadedList)
|
for (const std::unique_ptr<CPakFile>& pak : x18_pakLoadedList)
|
||||||
|
|
|
@ -22,7 +22,7 @@ class CResLoader
|
||||||
u32 x4c_cachedResId = -1;
|
u32 x4c_cachedResId = -1;
|
||||||
const CPakFile::SResInfo* x50_cachedResInfo = nullptr;
|
const CPakFile::SResInfo* x50_cachedResInfo = nullptr;
|
||||||
public:
|
public:
|
||||||
const std::vector<u32>* GetTagListForFile(const std::string& name) const;
|
const std::vector<ResId>* GetTagListForFile(const std::string& name) const;
|
||||||
void AddPakFileAsync(const std::string& name, bool samusPak, bool worldPak);
|
void AddPakFileAsync(const std::string& name, bool samusPak, bool worldPak);
|
||||||
void AddPakFile(const std::string& name, bool samusPak, bool worldPak);
|
void AddPakFile(const std::string& name, bool samusPak, bool worldPak);
|
||||||
CInputStream* LoadNewResourcePartSync(const SObjectTag& tag, int offset, int length, void* extBuf);
|
CInputStream* LoadNewResourcePartSync(const SObjectTag& tag, int offset, int length, void* extBuf);
|
||||||
|
|
|
@ -181,7 +181,7 @@ public:
|
||||||
static zeus::CVector3f g_ReflectViewPos;
|
static zeus::CVector3f g_ReflectViewPos;
|
||||||
static void KillCachedViewDepState();
|
static void KillCachedViewDepState();
|
||||||
static void EnsureViewDepStateCached(const CBooModel& model, const CBooSurface* surf,
|
static void EnsureViewDepStateCached(const CBooModel& model, const CBooSurface* surf,
|
||||||
zeus::CMatrix4f*& mtxsOut, float& alphaOut);
|
zeus::CMatrix4f* mtxsOut, float& alphaOut);
|
||||||
};
|
};
|
||||||
|
|
||||||
class CModel
|
class CModel
|
||||||
|
|
|
@ -57,7 +57,7 @@ static const zeus::CMatrix4f ReflectBaseMtx =
|
||||||
};
|
};
|
||||||
|
|
||||||
void CBooModel::EnsureViewDepStateCached(const CBooModel& model, const CBooSurface* surf,
|
void CBooModel::EnsureViewDepStateCached(const CBooModel& model, const CBooSurface* surf,
|
||||||
zeus::CMatrix4f*& mtxsOut, float& alphaOut)
|
zeus::CMatrix4f* mtxsOut, float& alphaOut)
|
||||||
{
|
{
|
||||||
zeus::CVector3f modelToPlayer = g_PlayerPosition - CGraphics::g_GXModelMatrix.origin;
|
zeus::CVector3f modelToPlayer = g_PlayerPosition - CGraphics::g_GXModelMatrix.origin;
|
||||||
zeus::CVector3f modelToPlayerLocal = CGraphics::g_GXModelMatrix.transposeRotate(modelToPlayer);
|
zeus::CVector3f modelToPlayerLocal = CGraphics::g_GXModelMatrix.transposeRotate(modelToPlayer);
|
||||||
|
|
|
@ -313,10 +313,57 @@ void CInGameGuiManager::Update(CStateManager& stateMgr, float dt, CArchitectureQ
|
||||||
EnsureStates(stateMgr);
|
EnsureStates(stateMgr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CInGameGuiManager::IsInGameStateNotTransitioning() const
|
||||||
|
{
|
||||||
|
return (x1bc_prevState >= EInGameGuiState::Zero && x1bc_prevState <= EInGameGuiState::InGame &&
|
||||||
|
x1c0_nextState >= EInGameGuiState::Zero && x1c0_nextState <= EInGameGuiState::InGame);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CInGameGuiManager::IsInPausedStateNotTransitioning() const
|
||||||
|
{
|
||||||
|
return (x1bc_prevState >= EInGameGuiState::MapScreen && x1bc_prevState <= EInGameGuiState::PauseHUDMessage &&
|
||||||
|
x1c0_nextState >= EInGameGuiState::MapScreen && x1c0_nextState <= EInGameGuiState::PauseHUDMessage);
|
||||||
|
}
|
||||||
|
|
||||||
void CInGameGuiManager::ProcessControllerInput(CStateManager& stateMgr, const CFinalInput& input,
|
void CInGameGuiManager::ProcessControllerInput(CStateManager& stateMgr, const CFinalInput& input,
|
||||||
CArchitectureQueue& archQueue)
|
CArchitectureQueue& archQueue)
|
||||||
{
|
{
|
||||||
|
if (input.ControllerIdx() == 0)
|
||||||
|
{
|
||||||
|
if (!IsInGameStateNotTransitioning())
|
||||||
|
{
|
||||||
|
if (IsInPausedStateNotTransitioning())
|
||||||
|
{
|
||||||
|
if (x1bc_prevState == EInGameGuiState::MapScreen)
|
||||||
|
{
|
||||||
|
if (x38_autoMapper->IsInMapperState(CAutoMapper::EAutoMapperState::MapScreen) ||
|
||||||
|
x38_autoMapper->IsInMapperState(CAutoMapper::EAutoMapperState::MapScreenUniverse))
|
||||||
|
{
|
||||||
|
x38_autoMapper->ProcessControllerInput(input, stateMgr);
|
||||||
|
if (x38_autoMapper->CanLeaveMapScreen(stateMgr))
|
||||||
|
BeginStateTransition(EInGameGuiState::InGame, stateMgr);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (x1bc_prevState == EInGameGuiState::PauseSaveGame)
|
||||||
|
{
|
||||||
|
x4c_saveUI->ProcessUserInput(input);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (x1bc_prevState == EInGameGuiState::PauseHUDMessage)
|
||||||
|
{
|
||||||
|
x44_messageScreen->ProcessControllerInput(input);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (x48_inventoryScreen)
|
||||||
|
x48_inventoryScreen->ProcessControllerInput(stateMgr, input);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x34_samusHud->ProcessControllerInput(input);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CInGameGuiManager::PreDraw(CStateManager& stateMgr)
|
void CInGameGuiManager::PreDraw(CStateManager& stateMgr)
|
||||||
|
|
|
@ -119,6 +119,8 @@ class CInGameGuiManager
|
||||||
void DoStateTransition(CStateManager& stateMgr);
|
void DoStateTransition(CStateManager& stateMgr);
|
||||||
void DestroyAreaTextures(CStateManager& stateMgr);
|
void DestroyAreaTextures(CStateManager& stateMgr);
|
||||||
void TryReloadAreaTextures();
|
void TryReloadAreaTextures();
|
||||||
|
bool IsInGameStateNotTransitioning() const;
|
||||||
|
bool IsInPausedStateNotTransitioning() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CInGameGuiManager(CStateManager& stateMgr, CArchitectureQueue& archQueue);
|
CInGameGuiManager(CStateManager& stateMgr, CArchitectureQueue& archQueue);
|
||||||
|
|
|
@ -23,5 +23,10 @@ CInventoryScreen::CInventoryScreen(u32 w1,
|
||||||
CSfxManager::SfxStart(1435, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId);
|
CSfxManager::SfxStart(1435, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CInventoryScreen::ProcessControllerInput(const CStateManager& mgr, const CFinalInput& input)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,6 +35,7 @@ class CInventoryScreen
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CInventoryScreen(u32 w1, const CDependencyGroup& suitDgrp, const CDependencyGroup& ballDgrp);
|
CInventoryScreen(u32 w1, const CDependencyGroup& suitDgrp, const CDependencyGroup& ballDgrp);
|
||||||
|
void ProcessControllerInput(const CStateManager& mgr, const CFinalInput& input);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,5 +10,10 @@ CMessageScreen::CMessageScreen(ResId msg, float time)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CMessageScreen::ProcessControllerInput(const CFinalInput& input)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
|
|
||||||
namespace urde
|
namespace urde
|
||||||
{
|
{
|
||||||
|
class CFinalInput;
|
||||||
|
|
||||||
namespace MP1
|
namespace MP1
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -12,6 +14,7 @@ class CMessageScreen
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CMessageScreen(ResId msg, float time);
|
CMessageScreen(ResId msg, float time);
|
||||||
|
void ProcessControllerInput(const CFinalInput& input);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1510,6 +1510,12 @@ void CSamusHud::Update(float dt, const CStateManager& mgr,
|
||||||
x29c_decoIntf->Update(dt, mgr);
|
x29c_decoIntf->Update(dt, mgr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSamusHud::ProcessControllerInput(const CFinalInput& input)
|
||||||
|
{
|
||||||
|
if (x29c_decoIntf)
|
||||||
|
x29c_decoIntf->ProcessInput(input);
|
||||||
|
}
|
||||||
|
|
||||||
void CSamusHud::UpdateStateTransition(float dt, const CStateManager& mgr)
|
void CSamusHud::UpdateStateTransition(float dt, const CStateManager& mgr)
|
||||||
{
|
{
|
||||||
if (x2cc_preLoadCountdown == 0)
|
if (x2cc_preLoadCountdown == 0)
|
||||||
|
|
|
@ -248,6 +248,7 @@ public:
|
||||||
void Update(float dt, const CStateManager& mgr,
|
void Update(float dt, const CStateManager& mgr,
|
||||||
DataSpec::ITweakGui::EHelmetVisMode helmetVis,
|
DataSpec::ITweakGui::EHelmetVisMode helmetVis,
|
||||||
bool hudVis, bool targetingManager);
|
bool hudVis, bool targetingManager);
|
||||||
|
void ProcessControllerInput(const CFinalInput& input);
|
||||||
void UpdateStateTransition(float time, const CStateManager& mgr);
|
void UpdateStateTransition(float time, const CStateManager& mgr);
|
||||||
bool CheckLoadComplete(CStateManager& stateMgr);
|
bool CheckLoadComplete(CStateManager& stateMgr);
|
||||||
void OnNewInGameGuiState(EInGameGuiState state, CStateManager& stateMgr);
|
void OnNewInGameGuiState(EInGameGuiState state, CStateManager& stateMgr);
|
||||||
|
|
|
@ -261,6 +261,16 @@ bool CMain::LoadAudio()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CMain::EnsureWorldPaksReady()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CMain::EnsureWorldPakReady(ResId mlvl)
|
||||||
|
{
|
||||||
|
/* TODO: Schedule resource list load for World Pak containing mlvl */
|
||||||
|
}
|
||||||
|
|
||||||
void CMain::StreamNewGameState(CBitStreamReader& r, u32 idx)
|
void CMain::StreamNewGameState(CBitStreamReader& r, u32 idx)
|
||||||
{
|
{
|
||||||
bool fusionBackup = g_GameState->SystemOptions().GetPlayerFusionSuitActive();
|
bool fusionBackup = g_GameState->SystemOptions().GetPlayerFusionSuitActive();
|
||||||
|
|
|
@ -290,6 +290,8 @@ public:
|
||||||
bool GetCardBusy() const { return x160_31_cardBusy; }
|
bool GetCardBusy() const { return x160_31_cardBusy; }
|
||||||
void SetCardBusy(bool v) { x160_31_cardBusy = v; }
|
void SetCardBusy(bool v) { x160_31_cardBusy = v; }
|
||||||
void SetGameFrameDrawn() { x161_24_gameFrameDrawn = true; }
|
void SetGameFrameDrawn() { x161_24_gameFrameDrawn = true; }
|
||||||
|
static void EnsureWorldPaksReady();
|
||||||
|
static void EnsureWorldPakReady(ResId mlvl);
|
||||||
|
|
||||||
EFlowState GetFlowState() const { return x12c_flowState; }
|
EFlowState GetFlowState() const { return x12c_flowState; }
|
||||||
void SetFlowState(EFlowState s) { x12c_flowState = s; }
|
void SetFlowState(EFlowState s) { x12c_flowState = s; }
|
||||||
|
|
|
@ -515,7 +515,7 @@ void CWorld::TravelToArea(TAreaId aid, CStateManager& mgr, bool skipLoadOther)
|
||||||
if (!toStreamCount && otherLoadArea && !x70_25_paused)
|
if (!toStreamCount && otherLoadArea && !x70_25_paused)
|
||||||
otherLoadArea->StartStreamIn(mgr);
|
otherLoadArea->StartStreamIn(mgr);
|
||||||
|
|
||||||
GetMapWorld()->SetWhichMapAreasLoaded(*this, aid, 3);
|
x28_mapWorld->SetWhichMapAreasLoaded(*this, aid, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CWorld::SetPauseState(bool paused)
|
void CWorld::SetPauseState(bool paused)
|
||||||
|
|
|
@ -169,7 +169,7 @@ public:
|
||||||
bool DoesAreaExist(TAreaId area) const;
|
bool DoesAreaExist(TAreaId area) const;
|
||||||
std::vector<std::unique_ptr<CGameArea>>& GetGameAreas() {return x18_areas;}
|
std::vector<std::unique_ptr<CGameArea>>& GetGameAreas() {return x18_areas;}
|
||||||
|
|
||||||
CMapWorld* GetMapWorld() {return x28_mapWorld.GetObj();}
|
const CMapWorld* GetMapWorld() const { return x28_mapWorld.GetObj(); }
|
||||||
u32 GetRelayCount() const { return x2c_relays.size(); }
|
u32 GetRelayCount() const { return x2c_relays.size(); }
|
||||||
CRelay GetRelay(u32 idx) const { return x2c_relays[idx]; }
|
CRelay GetRelay(u32 idx) const { return x2c_relays[idx]; }
|
||||||
|
|
||||||
|
|
2
specter
2
specter
|
@ -1 +1 @@
|
||||||
Subproject commit 0badca1998a07b8ac1c99c103e9f9b97daee9c60
|
Subproject commit fcec6f102176a49bede4693e6d5dbabf7c4dce00
|
Loading…
Reference in New Issue