mirror of https://github.com/AxioDL/metaforce.git
Merge branch 'master' into omegapirate
# Conflicts: # Runtime/GuiSys/CAuiImagePane.cpp
This commit is contained in:
commit
32c44cbf05
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
#include "Runtime/rstl.hpp"
|
#include "Runtime/rstl.hpp"
|
||||||
#include "Runtime/RetroTypes.hpp"
|
#include "Runtime/RetroTypes.hpp"
|
||||||
|
#include "Runtime/AutoMapper/CMapUniverse.hpp"
|
||||||
#include "Runtime/MP1/CInGameGuiManager.hpp"
|
#include "Runtime/MP1/CInGameGuiManager.hpp"
|
||||||
|
|
||||||
#include <zeus/CQuaternion.hpp>
|
#include <zeus/CQuaternion.hpp>
|
||||||
|
@ -17,7 +18,6 @@
|
||||||
#include <zeus/CVector3f.hpp>
|
#include <zeus/CVector3f.hpp>
|
||||||
|
|
||||||
namespace urde {
|
namespace urde {
|
||||||
class CMapUniverse;
|
|
||||||
class CMapWorldInfo;
|
class CMapWorldInfo;
|
||||||
class CStateManager;
|
class CStateManager;
|
||||||
class IWorld;
|
class IWorld;
|
||||||
|
|
|
@ -1377,7 +1377,11 @@ std::pair<TEditorId, TUniqueId> CStateManager::LoadScriptObject(TAreaId aid, ESc
|
||||||
in.readByte();
|
in.readByte();
|
||||||
|
|
||||||
if (error || ent == nullptr) {
|
if (error || ent == nullptr) {
|
||||||
LogModule.report(logvisor::Error, FMT_STRING("Script load error while loading {}"), ScriptObjectTypeToStr(type));
|
in.seek(startPos, athena::SeekOrigin::Begin);
|
||||||
|
std::string name = HashInstanceName(in);
|
||||||
|
in.seek(startPos + length, athena::SeekOrigin::Begin);
|
||||||
|
LogModule.report(logvisor::Error, FMT_STRING("Script load error while loading {}, name: {}"),
|
||||||
|
ScriptObjectTypeToStr(type), name);
|
||||||
return {kInvalidEditorId, kInvalidUniqueId};
|
return {kInvalidEditorId, kInvalidUniqueId};
|
||||||
} else {
|
} else {
|
||||||
LogModule.report(logvisor::Info, FMT_STRING("Loaded {} in area {}"), ent->GetName(), ent->GetAreaIdAlways());
|
LogModule.report(logvisor::Info, FMT_STRING("Loaded {} in area {}"), ent->GetName(), ent->GetAreaIdAlways());
|
||||||
|
|
|
@ -12,17 +12,17 @@ public:
|
||||||
double report(const char* name) const {
|
double report(const char* name) const {
|
||||||
double t = std::chrono::duration_cast<std::chrono::microseconds>(
|
double t = std::chrono::duration_cast<std::chrono::microseconds>(
|
||||||
std::chrono::steady_clock::now() - m_start).count() / 1000000.0;
|
std::chrono::steady_clock::now() - m_start).count() / 1000000.0;
|
||||||
#ifndef NDEBUG
|
//#ifndef NDEBUG
|
||||||
fmt::print(FMT_STRING("{} {}\n"), name, t);
|
// fmt::print(FMT_STRING("{} {}\n"), name, t);
|
||||||
#endif
|
//#endif
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
double reportReset(const char* name) {
|
double reportReset(const char* name) {
|
||||||
std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now();
|
std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now();
|
||||||
double t = std::chrono::duration_cast<std::chrono::microseconds>(now - m_start).count() / 1000000.0;
|
double t = std::chrono::duration_cast<std::chrono::microseconds>(now - m_start).count() / 1000000.0;
|
||||||
#ifndef NDEBUG
|
//#ifndef NDEBUG
|
||||||
fmt::print(FMT_STRING("{} {}\n"), name, t);
|
// fmt::print(FMT_STRING("{} {}\n"), name, t);
|
||||||
#endif
|
//#endif
|
||||||
m_start = now;
|
m_start = now;
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,7 +107,7 @@ public:
|
||||||
TToken(std::unique_ptr<T>&& obj) : CToken(GetIObjObjectFor(std::move(obj))) {}
|
TToken(std::unique_ptr<T>&& obj) : CToken(GetIObjObjectFor(std::move(obj))) {}
|
||||||
TToken& operator=(std::unique_ptr<T>&& obj) {
|
TToken& operator=(std::unique_ptr<T>&& obj) {
|
||||||
*this = CToken(GetIObjObjectFor(std::move(obj)));
|
*this = CToken(GetIObjObjectFor(std::move(obj)));
|
||||||
return this;
|
return *this;
|
||||||
}
|
}
|
||||||
virtual void Unlock() { CToken::Unlock(); }
|
virtual void Unlock() { CToken::Unlock(); }
|
||||||
virtual void Lock() { CToken::Lock(); }
|
virtual void Lock() { CToken::Lock(); }
|
||||||
|
|
|
@ -5,14 +5,13 @@
|
||||||
|
|
||||||
#include "Runtime/CToken.hpp"
|
#include "Runtime/CToken.hpp"
|
||||||
#include "Runtime/RetroTypes.hpp"
|
#include "Runtime/RetroTypes.hpp"
|
||||||
|
#include "Runtime/Graphics/CTexture.hpp"
|
||||||
#include "Runtime/Graphics/Shaders/CCameraBlurFilter.hpp"
|
#include "Runtime/Graphics/Shaders/CCameraBlurFilter.hpp"
|
||||||
#include "Runtime/Graphics/Shaders/CXRayBlurFilter.hpp"
|
#include "Runtime/Graphics/Shaders/CXRayBlurFilter.hpp"
|
||||||
|
|
||||||
#include <zeus/CColor.hpp>
|
#include <zeus/CColor.hpp>
|
||||||
|
|
||||||
namespace urde {
|
namespace urde {
|
||||||
class CTexture;
|
|
||||||
|
|
||||||
enum class EFilterType {
|
enum class EFilterType {
|
||||||
Passthru,
|
Passthru,
|
||||||
Multiply,
|
Multiply,
|
||||||
|
|
|
@ -5,10 +5,10 @@
|
||||||
#include "Runtime/CRandom16.hpp"
|
#include "Runtime/CRandom16.hpp"
|
||||||
#include "Runtime/CToken.hpp"
|
#include "Runtime/CToken.hpp"
|
||||||
#include "Runtime/GCNTypes.hpp"
|
#include "Runtime/GCNTypes.hpp"
|
||||||
|
#include "Runtime/Character/CTransitionDatabaseGame.hpp"
|
||||||
|
|
||||||
namespace urde {
|
namespace urde {
|
||||||
class CSimplePool;
|
class CSimplePool;
|
||||||
class CTransitionDatabaseGame;
|
|
||||||
|
|
||||||
struct CAnimSysContext {
|
struct CAnimSysContext {
|
||||||
TToken<CTransitionDatabaseGame> x0_transDB;
|
TToken<CTransitionDatabaseGame> x0_transDB;
|
||||||
|
|
|
@ -3,13 +3,12 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "Runtime/CToken.hpp"
|
#include "Runtime/CToken.hpp"
|
||||||
|
#include "Runtime/Character/CAnimationDatabaseGame.hpp"
|
||||||
#include "Runtime/Character/CAnimSysContext.hpp"
|
#include "Runtime/Character/CAnimSysContext.hpp"
|
||||||
|
|
||||||
namespace urde {
|
namespace urde {
|
||||||
class CAnimTreeNode;
|
class CAnimTreeNode;
|
||||||
class CAnimationDatabaseGame;
|
|
||||||
class CSimplePool;
|
class CSimplePool;
|
||||||
class CTransitionDatabaseGame;
|
|
||||||
class IMetaAnim;
|
class IMetaAnim;
|
||||||
|
|
||||||
struct CMetaAnimTreeBuildOrders;
|
struct CMetaAnimTreeBuildOrders;
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "Runtime/RetroTypes.hpp"
|
#include "Runtime/RetroTypes.hpp"
|
||||||
|
#include "Runtime/Character/CCharLayoutInfo.hpp"
|
||||||
#include "Runtime/Character/CSegId.hpp"
|
#include "Runtime/Character/CSegId.hpp"
|
||||||
|
|
||||||
#include <zeus/CMatrix3f.hpp>
|
#include <zeus/CMatrix3f.hpp>
|
||||||
|
@ -12,8 +13,6 @@
|
||||||
#include <zeus/CVector3f.hpp>
|
#include <zeus/CVector3f.hpp>
|
||||||
|
|
||||||
namespace urde {
|
namespace urde {
|
||||||
class CCharLayoutInfo;
|
|
||||||
|
|
||||||
class CPoseAsTransforms {
|
class CPoseAsTransforms {
|
||||||
friend class CAnimData;
|
friend class CAnimData;
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -9,9 +9,9 @@
|
||||||
#include "Runtime/Character/CInt32POINode.hpp"
|
#include "Runtime/Character/CInt32POINode.hpp"
|
||||||
#include "Runtime/Character/CParticlePOINode.hpp"
|
#include "Runtime/Character/CParticlePOINode.hpp"
|
||||||
#include "Runtime/Character/CSoundPOINode.hpp"
|
#include "Runtime/Character/CSoundPOINode.hpp"
|
||||||
|
#include "Runtime/Character/CTransitionDatabaseGame.hpp"
|
||||||
|
|
||||||
namespace urde {
|
namespace urde {
|
||||||
class CTransitionDatabaseGame;
|
|
||||||
class IMetaAnim;
|
class IMetaAnim;
|
||||||
|
|
||||||
class CSequenceFundamentals {
|
class CSequenceFundamentals {
|
||||||
|
|
|
@ -4,12 +4,12 @@
|
||||||
|
|
||||||
#include "Runtime/CToken.hpp"
|
#include "Runtime/CToken.hpp"
|
||||||
#include "Runtime/Character/CAnimSysContext.hpp"
|
#include "Runtime/Character/CAnimSysContext.hpp"
|
||||||
|
#include "Runtime/Character/CTransitionDatabaseGame.hpp"
|
||||||
|
|
||||||
namespace urde {
|
namespace urde {
|
||||||
class CAnimTreeNode;
|
class CAnimTreeNode;
|
||||||
class CRandom16;
|
class CRandom16;
|
||||||
class CSimplePool;
|
class CSimplePool;
|
||||||
class CTransitionDatabaseGame;
|
|
||||||
|
|
||||||
class CTransitionManager {
|
class CTransitionManager {
|
||||||
CAnimSysContext x0_animCtx;
|
CAnimSysContext x0_animCtx;
|
||||||
|
|
|
@ -14,15 +14,15 @@ namespace urde {
|
||||||
|
|
||||||
CActorList::CActorList() : CObjectList(EGameObjectList::Actor) {}
|
CActorList::CActorList() : CObjectList(EGameObjectList::Actor) {}
|
||||||
|
|
||||||
bool CActorList::IsQualified(const CEntity& ent) const { return TCastToConstPtr<CActor>(ent); }
|
bool CActorList::IsQualified(const CEntity& ent) const { return TCastToConstPtr<CActor>(ent).IsValid(); }
|
||||||
|
|
||||||
CPhysicsActorList::CPhysicsActorList() : CObjectList(EGameObjectList::PhysicsActor) {}
|
CPhysicsActorList::CPhysicsActorList() : CObjectList(EGameObjectList::PhysicsActor) {}
|
||||||
|
|
||||||
bool CPhysicsActorList::IsQualified(const CEntity& ent) const { return TCastToConstPtr<CPhysicsActor>(ent); }
|
bool CPhysicsActorList::IsQualified(const CEntity& ent) const { return TCastToConstPtr<CPhysicsActor>(ent).IsValid(); }
|
||||||
|
|
||||||
CGameCameraList::CGameCameraList() : CObjectList(EGameObjectList::GameCamera) {}
|
CGameCameraList::CGameCameraList() : CObjectList(EGameObjectList::GameCamera) {}
|
||||||
|
|
||||||
bool CGameCameraList::IsQualified(const CEntity& ent) const { return TCastToConstPtr<CGameCamera>(ent); }
|
bool CGameCameraList::IsQualified(const CEntity& ent) const { return TCastToConstPtr<CGameCamera>(ent).IsValid(); }
|
||||||
|
|
||||||
CListeningAiList::CListeningAiList() : CObjectList(EGameObjectList::ListeningAi) {}
|
CListeningAiList::CListeningAiList() : CObjectList(EGameObjectList::ListeningAi) {}
|
||||||
|
|
||||||
|
@ -41,12 +41,14 @@ CPlatformAndDoorList::CPlatformAndDoorList() : CObjectList(EGameObjectList::Plat
|
||||||
|
|
||||||
bool CPlatformAndDoorList::IsQualified(const CEntity& ent) const { return IsDoor(ent) || IsPlatform(ent); }
|
bool CPlatformAndDoorList::IsQualified(const CEntity& ent) const { return IsDoor(ent) || IsPlatform(ent); }
|
||||||
|
|
||||||
bool CPlatformAndDoorList::IsDoor(const CEntity& ent) const { return TCastToConstPtr<CScriptDoor>(ent); }
|
bool CPlatformAndDoorList::IsDoor(const CEntity& ent) const { return TCastToConstPtr<CScriptDoor>(ent).IsValid(); }
|
||||||
|
|
||||||
bool CPlatformAndDoorList::IsPlatform(const CEntity& ent) const { return TCastToConstPtr<CScriptPlatform>(ent); }
|
bool CPlatformAndDoorList::IsPlatform(const CEntity& ent) const {
|
||||||
|
return TCastToConstPtr<CScriptPlatform>(ent).IsValid();
|
||||||
|
}
|
||||||
|
|
||||||
CGameLightList::CGameLightList() : CObjectList(EGameObjectList::GameLight) {}
|
CGameLightList::CGameLightList() : CObjectList(EGameObjectList::GameLight) {}
|
||||||
|
|
||||||
bool CGameLightList::IsQualified(const CEntity& lt) const { return TCastToConstPtr<CGameLight>(lt); }
|
bool CGameLightList::IsQualified(const CEntity& lt) const { return TCastToConstPtr<CGameLight>(lt).IsValid(); }
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace urde
|
||||||
|
|
|
@ -5,12 +5,13 @@
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "DNACommon/CMDL.hpp"
|
#include "DataSpec/DNACommon/CMDL.hpp"
|
||||||
#include "DNAMP1/CMDLMaterials.hpp"
|
#include "DataSpec/DNAMP1/CMDLMaterials.hpp"
|
||||||
#include "Runtime/CFactoryMgr.hpp"
|
#include "Runtime/CFactoryMgr.hpp"
|
||||||
#include "Runtime/CToken.hpp"
|
#include "Runtime/CToken.hpp"
|
||||||
#include "Runtime/RetroTypes.hpp"
|
#include "Runtime/RetroTypes.hpp"
|
||||||
#include "Shaders/CModelShaders.hpp"
|
#include "Runtime/Graphics/CTexture.hpp"
|
||||||
|
#include "Runtime/Graphics/Shaders/CModelShaders.hpp"
|
||||||
|
|
||||||
#include <boo/graphicsdev/IGraphicsDataFactory.hpp>
|
#include <boo/graphicsdev/IGraphicsDataFactory.hpp>
|
||||||
#include <hecl/HMDLMeta.hpp>
|
#include <hecl/HMDLMeta.hpp>
|
||||||
|
@ -22,7 +23,6 @@ class CLight;
|
||||||
class CModel;
|
class CModel;
|
||||||
class CPoseAsTransforms;
|
class CPoseAsTransforms;
|
||||||
class CSkinRules;
|
class CSkinRules;
|
||||||
class CTexture;
|
|
||||||
class IObjectStore;
|
class IObjectStore;
|
||||||
|
|
||||||
struct CModelFlags {
|
struct CModelFlags {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "Runtime/Graphics/Shaders/CTextSupportShader.hpp"
|
#include "Runtime/Graphics/Shaders/CTextSupportShader.hpp"
|
||||||
|
|
||||||
|
#include "Runtime/GuiSys/CFontImageDef.hpp"
|
||||||
#include "Runtime/GuiSys/CRasterFont.hpp"
|
#include "Runtime/GuiSys/CRasterFont.hpp"
|
||||||
|
|
||||||
#include <hecl/Pipeline.hpp>
|
#include <hecl/Pipeline.hpp>
|
||||||
|
|
|
@ -69,9 +69,9 @@ void CAuiImagePane::DoDrawImagePane(const zeus::CColor& color, const CTexture& t
|
||||||
const zeus::CVector2f res(xb8_tex0Tok->GetWidth(), xb8_tex0Tok->GetHeight());
|
const zeus::CVector2f res(xb8_tex0Tok->GetWidth(), xb8_tex0Tok->GetHeight());
|
||||||
const zeus::CVector2f tmp = res / x138_tileSize;
|
const zeus::CVector2f tmp = res / x138_tileSize;
|
||||||
const zeus::CVector2f tmpRecip = x138_tileSize / res;
|
const zeus::CVector2f tmpRecip = x138_tileSize / res;
|
||||||
const float x0 = tmpRecip.x() * (frame % int(tmp.x()));
|
const float x0 = tmpRecip.x() * static_cast<float>(frame % static_cast<int>(tmp.x()));
|
||||||
const float x1 = x0 + tmpRecip.x();
|
const float x1 = x0 + tmpRecip.x();
|
||||||
const float y0 = tmpRecip.y() * (frame % int(tmp.y()));
|
const float y0 = tmpRecip.y() * static_cast<float>(frame % static_cast<int>(tmp.y()));
|
||||||
const float y1 = y0 + tmpRecip.y();
|
const float y1 = y0 + tmpRecip.y();
|
||||||
vec.push_back(zeus::CVector2f(x0, y0));
|
vec.push_back(zeus::CVector2f(x0, y0));
|
||||||
vec.push_back(zeus::CVector2f(x0, y1));
|
vec.push_back(zeus::CVector2f(x0, y1));
|
||||||
|
@ -96,7 +96,7 @@ void CAuiImagePane::DoDrawImagePane(const zeus::CColor& color, const CTexture& t
|
||||||
} else {
|
} else {
|
||||||
const float tmp = (1.f - x14c_deResFactor) * alpha;
|
const float tmp = (1.f - x14c_deResFactor) * alpha;
|
||||||
const float tmp3 = 1.f - tmp * tmp * tmp;
|
const float tmp3 = 1.f - tmp * tmp * tmp;
|
||||||
const float mip = tmp3 * (tex.GetNumMips() - 1);
|
const float mip = tmp3 * static_cast<float>(tex.GetNumMips() - 1);
|
||||||
quad.drawVerts(useColor, verts, mip);
|
quad.drawVerts(useColor, verts, mip);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -117,11 +117,11 @@ void CAuiImagePane::Draw(const CGuiWidgetDrawParms& params) {
|
||||||
// SetZUpdate(xac_drawFlags == EGuiModelDrawFlags::Shadeless || xac_drawFlags == EGuiModelDrawFlags::Opaque);
|
// SetZUpdate(xac_drawFlags == EGuiModelDrawFlags::Shadeless || xac_drawFlags == EGuiModelDrawFlags::Opaque);
|
||||||
float blur0 = 1.f;
|
float blur0 = 1.f;
|
||||||
float blur1 = 0.f;
|
float blur1 = 0.f;
|
||||||
int frame0 = x144_frameTimer;
|
const int frame0 = static_cast<int>(x144_frameTimer);
|
||||||
int frame1 = 0;
|
int frame1 = 0;
|
||||||
if (x140_interval < 1.f && x140_interval > 0.f) {
|
if (x140_interval < 1.f && x140_interval > 0.f) {
|
||||||
zeus::CVector2f tmp = zeus::CVector2f(xb8_tex0Tok->GetWidth(), xb8_tex0Tok->GetHeight()) / x138_tileSize;
|
zeus::CVector2f tmp = zeus::CVector2f(xb8_tex0Tok->GetWidth(), xb8_tex0Tok->GetHeight()) / x138_tileSize;
|
||||||
frame1 = (frame0 + 1) % int(tmp.x() * tmp.y());
|
frame1 = (frame0 + 1) % static_cast<int>(tmp.x() * tmp.y());
|
||||||
if (x148_fadeDuration == 0.f)
|
if (x148_fadeDuration == 0.f)
|
||||||
blur1 = 1.f;
|
blur1 = 1.f;
|
||||||
else
|
else
|
||||||
|
|
|
@ -220,7 +220,7 @@ void CCompoundTargetReticle::Update(float dt, const CStateManager& mgr) {
|
||||||
std::max(x214_fullChargeFadeTimer - dt / g_tweakTargeting->GetFullChargeFadeDuration(), 0.f);
|
std::max(x214_fullChargeFadeTimer - dt / g_tweakTargeting->GetFullChargeFadeDuration(), 0.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool missileActive = gun->GetMissleMode() == CPlayerGun::EMissleMode::Active;
|
const bool missileActive = gun->GetMissleMode() == CPlayerGun::EMissileMode::Active;
|
||||||
if (missileActive != x1f4_missileActive) {
|
if (missileActive != x1f4_missileActive) {
|
||||||
if (x1f8_missileBracketTimer != 0.f) {
|
if (x1f8_missileBracketTimer != 0.f) {
|
||||||
x1f8_missileBracketTimer = FLT_EPSILON - x1f8_missileBracketTimer;
|
x1f8_missileBracketTimer = FLT_EPSILON - x1f8_missileBracketTimer;
|
||||||
|
|
|
@ -9,12 +9,12 @@
|
||||||
#include "Runtime/CToken.hpp"
|
#include "Runtime/CToken.hpp"
|
||||||
#include "Runtime/RetroTypes.hpp"
|
#include "Runtime/RetroTypes.hpp"
|
||||||
#include "Runtime/GuiSys/CGuiWidget.hpp"
|
#include "Runtime/GuiSys/CGuiWidget.hpp"
|
||||||
|
#include "Runtime/GuiSys/CRasterFont.hpp"
|
||||||
#include "Runtime/GuiSys/CTextRenderBuffer.hpp"
|
#include "Runtime/GuiSys/CTextRenderBuffer.hpp"
|
||||||
|
|
||||||
#include <zeus/CColor.hpp>
|
#include <zeus/CColor.hpp>
|
||||||
|
|
||||||
namespace urde {
|
namespace urde {
|
||||||
class CRasterFont;
|
|
||||||
class CSimplePool;
|
class CSimplePool;
|
||||||
class CTextExecuteBuffer;
|
class CTextExecuteBuffer;
|
||||||
class CTextRenderBuffer;
|
class CTextRenderBuffer;
|
||||||
|
@ -34,8 +34,6 @@ enum class EVerticalJustification {
|
||||||
RightMono
|
RightMono
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class EColorType { Main, Outline, Geometry, Foreground, Background };
|
|
||||||
|
|
||||||
enum class ETextDirection { Horizontal, Vertical };
|
enum class ETextDirection { Horizontal, Vertical };
|
||||||
|
|
||||||
class CGuiTextProperties {
|
class CGuiTextProperties {
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
#include "Runtime/GCNTypes.hpp"
|
#include "Runtime/GCNTypes.hpp"
|
||||||
#include "Runtime/IOStreams.hpp"
|
#include "Runtime/IOStreams.hpp"
|
||||||
#include "Runtime/Graphics/CTexture.hpp"
|
#include "Runtime/Graphics/CTexture.hpp"
|
||||||
#include "Runtime/GuiSys/CGuiTextSupport.hpp"
|
|
||||||
|
|
||||||
#include <zeus/CVector2i.hpp>
|
#include <zeus/CVector2i.hpp>
|
||||||
|
|
||||||
|
@ -17,6 +16,8 @@ class CDrawStringOptions;
|
||||||
class CTextRenderBuffer;
|
class CTextRenderBuffer;
|
||||||
class IObjectStore;
|
class IObjectStore;
|
||||||
|
|
||||||
|
enum class EColorType { Main, Outline, Geometry, Foreground, Background };
|
||||||
|
|
||||||
/* NOTE: Is this a good place for CGlyph and CKernPair? */
|
/* NOTE: Is this a good place for CGlyph and CKernPair? */
|
||||||
class CGlyph {
|
class CGlyph {
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -6,12 +6,11 @@
|
||||||
#include "Runtime/GCNTypes.hpp"
|
#include "Runtime/GCNTypes.hpp"
|
||||||
#include "Runtime/GuiSys/CDrawStringOptions.hpp"
|
#include "Runtime/GuiSys/CDrawStringOptions.hpp"
|
||||||
#include "Runtime/GuiSys/CGuiTextSupport.hpp"
|
#include "Runtime/GuiSys/CGuiTextSupport.hpp"
|
||||||
|
#include "Runtime/GuiSys/CRasterFont.hpp"
|
||||||
|
|
||||||
#include <zeus/CColor.hpp>
|
#include <zeus/CColor.hpp>
|
||||||
|
|
||||||
namespace urde {
|
namespace urde {
|
||||||
class CRasterFont;
|
|
||||||
|
|
||||||
class CSaveableState {
|
class CSaveableState {
|
||||||
friend class CColorOverrideInstruction;
|
friend class CColorOverrideInstruction;
|
||||||
friend class CFontInstruction;
|
friend class CFontInstruction;
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
#include "DataSpec/DNACommon/Tweaks/ITweakGui.hpp"
|
#include "DataSpec/DNACommon/Tweaks/ITweakGui.hpp"
|
||||||
|
|
||||||
|
#include "Runtime/CDependencyGroup.hpp"
|
||||||
#include "Runtime/CRandom16.hpp"
|
#include "Runtime/CRandom16.hpp"
|
||||||
#include "Runtime/CToken.hpp"
|
#include "Runtime/CToken.hpp"
|
||||||
#include "Runtime/CStateManager.hpp"
|
#include "Runtime/CStateManager.hpp"
|
||||||
|
@ -30,7 +31,6 @@ namespace urde {
|
||||||
class CActorLights;
|
class CActorLights;
|
||||||
class CArchitectureQueue;
|
class CArchitectureQueue;
|
||||||
class CAutoMapper;
|
class CAutoMapper;
|
||||||
class CDependencyGroup;
|
|
||||||
class CGuiCamera;
|
class CGuiCamera;
|
||||||
class CGuiModel;
|
class CGuiModel;
|
||||||
class CModelData;
|
class CModelData;
|
||||||
|
|
|
@ -139,7 +139,7 @@ void CSamusHud::InitializeFrameGlueMutable(const CStateManager& mgr) {
|
||||||
CPlayerState& playerState = *mgr.GetPlayerState();
|
CPlayerState& playerState = *mgr.GetPlayerState();
|
||||||
CPlayerGun& gun = *player.GetPlayerGun();
|
CPlayerGun& gun = *player.GetPlayerGun();
|
||||||
float chargeFactor = gun.IsCharging() ? gun.GetChargeBeamFactor() : 0.f;
|
float chargeFactor = gun.IsCharging() ? gun.GetChargeBeamFactor() : 0.f;
|
||||||
bool missilesActive = gun.GetMissleMode() == CPlayerGun::EMissleMode::Active;
|
bool missilesActive = gun.GetMissleMode() == CPlayerGun::EMissileMode::Active;
|
||||||
bool lockedOnObj = player.GetOrbitTargetId() != kInvalidUniqueId;
|
bool lockedOnObj = player.GetOrbitTargetId() != kInvalidUniqueId;
|
||||||
|
|
||||||
switch (x2bc_nextState) {
|
switch (x2bc_nextState) {
|
||||||
|
@ -477,7 +477,7 @@ void CSamusHud::UpdateMissile(float dt, const CStateManager& mgr, bool init) {
|
||||||
|
|
||||||
u32 numMissles = playerState.GetItemAmount(CPlayerState::EItemType::Missiles);
|
u32 numMissles = playerState.GetItemAmount(CPlayerState::EItemType::Missiles);
|
||||||
u32 missileCap = playerState.GetItemCapacity(CPlayerState::EItemType::Missiles);
|
u32 missileCap = playerState.GetItemCapacity(CPlayerState::EItemType::Missiles);
|
||||||
CPlayerGun::EMissleMode missileMode = gun.GetMissleMode();
|
CPlayerGun::EMissileMode missileMode = gun.GetMissleMode();
|
||||||
float chargeFactor = gun.IsCharging() ? gun.GetChargeBeamFactor() : 0.f;
|
float chargeFactor = gun.IsCharging() ? gun.GetChargeBeamFactor() : 0.f;
|
||||||
|
|
||||||
if (x294_missileIntf)
|
if (x294_missileIntf)
|
||||||
|
@ -491,7 +491,7 @@ void CSamusHud::UpdateMissile(float dt, const CStateManager& mgr, bool init) {
|
||||||
if (numMissles != x2d8_missileAmount)
|
if (numMissles != x2d8_missileAmount)
|
||||||
x294_missileIntf->SetNumMissiles(numMissles, mgr);
|
x294_missileIntf->SetNumMissiles(numMissles, mgr);
|
||||||
if (missileMode != x2ec_missileMode)
|
if (missileMode != x2ec_missileMode)
|
||||||
x294_missileIntf->SetIsMissilesActive(missileMode == CPlayerGun::EMissleMode::Active);
|
x294_missileIntf->SetIsMissilesActive(missileMode == CPlayerGun::EMissileMode::Active);
|
||||||
}
|
}
|
||||||
x2d8_missileAmount = numMissles;
|
x2d8_missileAmount = numMissles;
|
||||||
x2ec_missileMode = missileMode;
|
x2ec_missileMode = missileMode;
|
||||||
|
@ -600,7 +600,7 @@ void CSamusHud::UpdateCameraDebugSettings() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSamusHud::UpdateEnergyLow(float dt, const CStateManager& mgr) {
|
void CSamusHud::UpdateEnergyLow(float dt, const CStateManager& mgr) {
|
||||||
bool cineCam = TCastToConstPtr<CCinematicCamera>(mgr.GetCameraManager()->GetCurrentCamera(mgr));
|
const bool cineCam = TCastToConstPtr<CCinematicCamera>(mgr.GetCameraManager()->GetCurrentCamera(mgr)).IsValid();
|
||||||
float oldTimer = x57c_energyLowTimer;
|
float oldTimer = x57c_energyLowTimer;
|
||||||
|
|
||||||
x57c_energyLowTimer = std::fmod(x57c_energyLowTimer + dt, 0.5f);
|
x57c_energyLowTimer = std::fmod(x57c_energyLowTimer + dt, 0.5f);
|
||||||
|
|
|
@ -101,7 +101,7 @@ class CSamusHud {
|
||||||
bool x2e0_27_energyLow : 1;
|
bool x2e0_27_energyLow : 1;
|
||||||
u32 x2e4_ = 0;
|
u32 x2e4_ = 0;
|
||||||
u32 x2e8_ = 0;
|
u32 x2e8_ = 0;
|
||||||
CPlayerGun::EMissleMode x2ec_missileMode = CPlayerGun::EMissleMode::Inactive;
|
CPlayerGun::EMissileMode x2ec_missileMode = CPlayerGun::EMissileMode::Inactive;
|
||||||
float x2f0_visorBeamMenuAlpha = 1.f;
|
float x2f0_visorBeamMenuAlpha = 1.f;
|
||||||
zeus::CVector3f x2f8_fpCamDir;
|
zeus::CVector3f x2f8_fpCamDir;
|
||||||
zeus::CVector3f x304_basewidgetIdlePos;
|
zeus::CVector3f x304_basewidgetIdlePos;
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "Runtime/CDependencyGroup.hpp"
|
||||||
#include "Runtime/CIOWin.hpp"
|
#include "Runtime/CIOWin.hpp"
|
||||||
#include "Runtime/CToken.hpp"
|
#include "Runtime/CToken.hpp"
|
||||||
#include "Runtime/RetroTypes.hpp"
|
#include "Runtime/RetroTypes.hpp"
|
||||||
|
@ -16,7 +17,6 @@
|
||||||
#include <zeus/CVector2f.hpp>
|
#include <zeus/CVector2f.hpp>
|
||||||
|
|
||||||
namespace urde {
|
namespace urde {
|
||||||
class CDependencyGroup;
|
|
||||||
class CTexture;
|
class CTexture;
|
||||||
|
|
||||||
class CSlideShow : public CIOWin {
|
class CSlideShow : public CIOWin {
|
||||||
|
|
|
@ -297,9 +297,9 @@ void CFlaahgra::DoUserAnimEvent(CStateManager& mgr, const CInt32POINode& node, E
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case EUserEventType::BeginAction: {
|
case EUserEventType::BeginAction: {
|
||||||
#ifndef NDEBUG
|
//#ifndef NDEBUG
|
||||||
printf("BeginAction\n");
|
// printf("BeginAction\n");
|
||||||
#endif
|
//#endif
|
||||||
x8e4_26_ = true;
|
x8e4_26_ = true;
|
||||||
x7c4_ = GetEndActionTime();
|
x7c4_ = GetEndActionTime();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -132,7 +132,8 @@ headerf.write('''
|
||||||
operator T*() const { return GetPtr(); }
|
operator T*() const { return GetPtr(); }
|
||||||
T& operator*() const { return *GetPtr(); }
|
T& operator*() const { return *GetPtr(); }
|
||||||
T* operator->() const { return GetPtr(); }
|
T* operator->() const { return GetPtr(); }
|
||||||
operator bool() const { return ptr != nullptr; }
|
bool IsValid() const { return ptr != nullptr; }
|
||||||
|
explicit operator bool() const { return IsValid(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
|
@ -147,7 +148,8 @@ public:
|
||||||
operator const T*() const { return GetPtr(); }
|
operator const T*() const { return GetPtr(); }
|
||||||
const T& operator*() const { return *GetPtr(); }
|
const T& operator*() const { return *GetPtr(); }
|
||||||
const T* operator->() const { return GetPtr(); }
|
const T* operator->() const { return GetPtr(); }
|
||||||
operator bool() const { return TCastToPtr<T>::ptr != nullptr; }
|
bool IsValid() const { return TCastToPtr<T>::ptr != nullptr; }
|
||||||
|
explicit operator bool() const { return IsValid(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "Runtime/IOStreams.hpp"
|
#include "Runtime/IOStreams.hpp"
|
||||||
#include "Runtime/IObj.hpp"
|
#include "Runtime/IObj.hpp"
|
||||||
#include "Runtime/RetroTypes.hpp"
|
#include "Runtime/RetroTypes.hpp"
|
||||||
|
#include "Runtime/Graphics/CModel.hpp"
|
||||||
|
|
||||||
namespace urde {
|
namespace urde {
|
||||||
class CColorElement;
|
class CColorElement;
|
||||||
|
@ -16,7 +17,6 @@ class CEmitterElement;
|
||||||
class CGenDescription;
|
class CGenDescription;
|
||||||
class CIntElement;
|
class CIntElement;
|
||||||
class CModVectorElement;
|
class CModVectorElement;
|
||||||
class CModel;
|
|
||||||
class CRealElement;
|
class CRealElement;
|
||||||
class CSimplePool;
|
class CSimplePool;
|
||||||
class CSwooshDescription;
|
class CSwooshDescription;
|
||||||
|
@ -100,3 +100,9 @@ CFactoryFnReturn FParticleFactory(const SObjectTag& tag, CInputStream& in, const
|
||||||
CObjectReference* selfRef);
|
CObjectReference* selfRef);
|
||||||
|
|
||||||
} // namespace urde
|
} // namespace urde
|
||||||
|
|
||||||
|
// FIXME hacky workaround for MSVC; these need to be complete types
|
||||||
|
// but introduce circular dependencies if included at the start
|
||||||
|
#include "Runtime/Particle/CGenDescription.hpp"
|
||||||
|
#include "Runtime/Particle/CSwooshDescription.hpp"
|
||||||
|
#include "Runtime/Particle/CElectricDescription.hpp"
|
|
@ -19,9 +19,15 @@ CBurstFire::CBurstFire(const SBurst* const* burstDefs, s32 firstBurstCount)
|
||||||
|
|
||||||
void CBurstFire::Update(CStateManager& mgr, float dt) {
|
void CBurstFire::Update(CStateManager& mgr, float dt) {
|
||||||
x14_24_shouldFire = false;
|
x14_24_shouldFire = false;
|
||||||
if (x18_curBursts) {
|
if (!x18_curBursts) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
x8_timeToNextShot -= dt;
|
x8_timeToNextShot -= dt;
|
||||||
if (x8_timeToNextShot < 0.f) {
|
if (x8_timeToNextShot >= 0.f) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
x4_angleIdx += 1;
|
x4_angleIdx += 1;
|
||||||
if (x18_curBursts->x4_shotAngles[x4_angleIdx] > 0) {
|
if (x18_curBursts->x4_shotAngles[x4_angleIdx] > 0) {
|
||||||
x14_24_shouldFire = true;
|
x14_24_shouldFire = true;
|
||||||
|
@ -30,8 +36,6 @@ void CBurstFire::Update(CStateManager& mgr, float dt) {
|
||||||
} else {
|
} else {
|
||||||
x18_curBursts = nullptr;
|
x18_curBursts = nullptr;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
zeus::CVector3f CBurstFire::GetDistanceCompensatedError(float dist, float maxErrDist) const {
|
zeus::CVector3f CBurstFire::GetDistanceCompensatedError(float dist, float maxErrDist) const {
|
||||||
|
@ -67,18 +71,25 @@ void CBurstFire::Start(CStateManager& mgr) {
|
||||||
}
|
}
|
||||||
|
|
||||||
zeus::CVector3f CBurstFire::GetError(float xMag, float zMag) const {
|
zeus::CVector3f CBurstFire::GetError(float xMag, float zMag) const {
|
||||||
zeus::CVector3f ret;
|
if (!x14_24_shouldFire || !x18_curBursts) {
|
||||||
if (x14_24_shouldFire && x18_curBursts) {
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
s32 r0 = x18_curBursts->x4_shotAngles[x4_angleIdx];
|
s32 r0 = x18_curBursts->x4_shotAngles[x4_angleIdx];
|
||||||
if (x14_25_avoidAccuracy && (r0 == 4 || r0 == 12))
|
if (x14_25_avoidAccuracy && (r0 == 4 || r0 == 12)) {
|
||||||
r0 = x4_angleIdx > 0 ? x18_curBursts->x4_shotAngles[x4_angleIdx - 1]
|
r0 =
|
||||||
: x18_curBursts->x4_shotAngles[x4_angleIdx + 1];
|
x4_angleIdx > 0 ? x18_curBursts->x4_shotAngles[x4_angleIdx - 1] : x18_curBursts->x4_shotAngles[x4_angleIdx + 1];
|
||||||
if (r0 > 0) {
|
}
|
||||||
float angle = r0 * zeus::degToRad(-22.5f);
|
|
||||||
|
if (r0 <= 0) {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
const float angle = r0 * zeus::degToRad(-22.5f);
|
||||||
|
zeus::CVector3f ret;
|
||||||
ret.x() = std::cos(angle) * xMag;
|
ret.x() = std::cos(angle) * xMag;
|
||||||
ret.z() = std::sin(angle) * zMag;
|
ret.z() = std::sin(angle) * zMag;
|
||||||
}
|
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include "Runtime/Character/CAnimCharacterSet.hpp"
|
#include "Runtime/Character/CAnimCharacterSet.hpp"
|
||||||
#include "Runtime/Collision/CMaterialList.hpp"
|
#include "Runtime/Collision/CMaterialList.hpp"
|
||||||
#include "Runtime/Particle/CElementGen.hpp"
|
#include "Runtime/Particle/CElementGen.hpp"
|
||||||
|
#include "Runtime/Particle/CWeaponDescription.hpp"
|
||||||
#include "Runtime/Weapon/CGunController.hpp"
|
#include "Runtime/Weapon/CGunController.hpp"
|
||||||
#include "Runtime/Weapon/CGunMotion.hpp"
|
#include "Runtime/Weapon/CGunMotion.hpp"
|
||||||
#include "Runtime/Weapon/CWeaponMgr.hpp"
|
#include "Runtime/Weapon/CWeaponMgr.hpp"
|
||||||
|
@ -25,7 +26,6 @@ namespace urde {
|
||||||
|
|
||||||
class CActorLights;
|
class CActorLights;
|
||||||
struct CModelFlags;
|
struct CModelFlags;
|
||||||
class CWeaponDescription;
|
|
||||||
|
|
||||||
enum class EChargeState { Normal, Charged };
|
enum class EChargeState { Normal, Charged };
|
||||||
|
|
||||||
|
|
|
@ -501,7 +501,7 @@ void CPlayerGun::ResetCharge(CStateManager& mgr, bool resetBeam) {
|
||||||
x2f8_stateFlags &= 0xFFE9;
|
x2f8_stateFlags &= 0xFFE9;
|
||||||
}
|
}
|
||||||
x318_comboAmmoIdx = 0;
|
x318_comboAmmoIdx = 0;
|
||||||
x31c_missileMode = EMissleMode::Inactive;
|
x31c_missileMode = EMissileMode::Inactive;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -587,7 +587,7 @@ void CPlayerGun::Reset(CStateManager& mgr, bool b1) {
|
||||||
x2f8_stateFlags &= 0xFFE9;
|
x2f8_stateFlags &= 0xFFE9;
|
||||||
}
|
}
|
||||||
x318_comboAmmoIdx = 0;
|
x318_comboAmmoIdx = 0;
|
||||||
x31c_missileMode = EMissleMode::Inactive;
|
x31c_missileMode = EMissileMode::Inactive;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
x2f8_stateFlags &= ~0x7;
|
x2f8_stateFlags &= ~0x7;
|
||||||
|
@ -784,7 +784,7 @@ void CPlayerGun::CancelFiring(CStateManager& mgr) {
|
||||||
x2f8_stateFlags &= 0xFFE9;
|
x2f8_stateFlags &= 0xFFE9;
|
||||||
}
|
}
|
||||||
x318_comboAmmoIdx = 0;
|
x318_comboAmmoIdx = 0;
|
||||||
x31c_missileMode = EMissleMode::Inactive;
|
x31c_missileMode = EMissileMode::Inactive;
|
||||||
}
|
}
|
||||||
if (x32c_chargePhase != EChargePhase::NotCharging) {
|
if (x32c_chargePhase != EChargePhase::NotCharging) {
|
||||||
x72c_currentBeam->ActivateCharge(false, false);
|
x72c_currentBeam->ActivateCharge(false, false);
|
||||||
|
@ -820,8 +820,7 @@ void CPlayerGun::StopContinuousBeam(CStateManager& mgr, bool b1) {
|
||||||
} else if (x833_28_phazonBeamActive) {
|
} else if (x833_28_phazonBeamActive) {
|
||||||
if (static_cast<CPhazonBeam*>(x72c_currentBeam)->IsFiring())
|
if (static_cast<CPhazonBeam*>(x72c_currentBeam)->IsFiring())
|
||||||
static_cast<CPhazonBeam*>(x72c_currentBeam)->StopBeam(mgr, b1);
|
static_cast<CPhazonBeam*>(x72c_currentBeam)->StopBeam(mgr, b1);
|
||||||
} else if (x310_currentBeam == CPlayerState::EBeamId::Plasma) // Plasma
|
} else if (x310_currentBeam == CPlayerState::EBeamId::Plasma) {
|
||||||
{
|
|
||||||
if (static_cast<CPlasmaBeam*>(x72c_currentBeam)->IsFiring())
|
if (static_cast<CPlasmaBeam*>(x72c_currentBeam)->IsFiring())
|
||||||
static_cast<CPlasmaBeam*>(x72c_currentBeam)->StopBeam(mgr, b1);
|
static_cast<CPlasmaBeam*>(x72c_currentBeam)->StopBeam(mgr, b1);
|
||||||
}
|
}
|
||||||
|
@ -839,9 +838,9 @@ void CPlayerGun::CMotionState::Update(bool firing, float dt, zeus::CTransform& x
|
||||||
|
|
||||||
if (x0_24_extendParabola && x20_state == EMotionState::LockOn) {
|
if (x0_24_extendParabola && x20_state == EMotionState::LockOn) {
|
||||||
float extendT = xc_curExtendDist / gGunExtendDistance;
|
float extendT = xc_curExtendDist / gGunExtendDistance;
|
||||||
xf = xf * zeus::CTransform::RotateZ(zeus::degToRad(extendT * -4.f * (extendT - 1.f) * 15.f));
|
xf = xf * zeus::CTransform(zeus::CMatrix3f::RotateZ(zeus::degToRad(extendT * -4.f * (extendT - 1.f) * 15.f)),
|
||||||
} else {
|
{0.f, xc_curExtendDist, 0.f});
|
||||||
if (x24_fireState == EFireState::StartFire || x24_fireState == EFireState::Firing) {
|
} else if (x24_fireState == EFireState::StartFire || x24_fireState == EFireState::Firing) {
|
||||||
if (std::fabs(x14_rotationT - 1.f) < 0.1f) {
|
if (std::fabs(x14_rotationT - 1.f) < 0.1f) {
|
||||||
x18_startRotation = x1c_endRotation;
|
x18_startRotation = x1c_endRotation;
|
||||||
x14_rotationT = 0.f;
|
x14_rotationT = 0.f;
|
||||||
|
@ -861,14 +860,13 @@ void CPlayerGun::CMotionState::Update(bool firing, float dt, zeus::CTransform& x
|
||||||
|
|
||||||
x14_rotationT += (1.f - x14_rotationT) * 0.8f * (10.f * dt);
|
x14_rotationT += (1.f - x14_rotationT) * 0.8f * (10.f * dt);
|
||||||
zeus::CTransform tmpXf =
|
zeus::CTransform tmpXf =
|
||||||
zeus::CQuaternion::fromAxisAngle(xf.basis[1], zeus::degToRad(x10_curRotation)).toTransform() *
|
zeus::CQuaternion::fromAxisAngle(xf.frontVector(), zeus::degToRad(x10_curRotation)).toTransform() *
|
||||||
xf.getRotation();
|
xf.getRotation();
|
||||||
tmpXf.origin = xf.origin;
|
tmpXf.origin = xf.origin;
|
||||||
xf = tmpXf * zeus::CTransform::Translate(0.f, xc_curExtendDist, 0.f);
|
xf = tmpXf * zeus::CTransform::Translate(0.f, xc_curExtendDist, 0.f);
|
||||||
} else {
|
} else {
|
||||||
xf = xf * zeus::CTransform::Translate(0.f, xc_curExtendDist, 0.f);
|
xf = xf * zeus::CTransform::Translate(0.f, xc_curExtendDist, 0.f);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
switch (x20_state) {
|
switch (x20_state) {
|
||||||
case EMotionState::LockOn:
|
case EMotionState::LockOn:
|
||||||
|
@ -1272,7 +1270,7 @@ void CPlayerGun::UpdateAuxWeapons(float dt, const zeus::CTransform& targetXf, CS
|
||||||
x2f8_stateFlags &= 0xFFE9;
|
x2f8_stateFlags &= 0xFFE9;
|
||||||
}
|
}
|
||||||
x318_comboAmmoIdx = 0;
|
x318_comboAmmoIdx = 0;
|
||||||
x31c_missileMode = EMissleMode::Inactive;
|
x31c_missileMode = EMissileMode::Inactive;
|
||||||
}
|
}
|
||||||
} else if (x833_28_phazonBeamActive) {
|
} else if (x833_28_phazonBeamActive) {
|
||||||
static_cast<CPhazonBeam*>(x72c_currentBeam)->UpdateBeam(dt, targetXf, x418_beamLocalXf.origin, mgr);
|
static_cast<CPhazonBeam*>(x72c_currentBeam)->UpdateBeam(dt, targetXf, x418_beamLocalXf.origin, mgr);
|
||||||
|
@ -1581,7 +1579,7 @@ void CPlayerGun::UpdateWeaponFire(float dt, const CPlayerState& playerState, CSt
|
||||||
x2f8_stateFlags &= ~0x1;
|
x2f8_stateFlags &= ~0x1;
|
||||||
x2f8_stateFlags |= 0x6;
|
x2f8_stateFlags |= 0x6;
|
||||||
x318_comboAmmoIdx = 1;
|
x318_comboAmmoIdx = 1;
|
||||||
x31c_missileMode = EMissleMode::Active;
|
x31c_missileMode = EMissileMode::Active;
|
||||||
}
|
}
|
||||||
FireSecondary(dt, mgr);
|
FireSecondary(dt, mgr);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1875,7 +1873,7 @@ void CPlayerGun::Update(float grappleSwingT, float cameraBobT, float dt, CStateM
|
||||||
x2f8_stateFlags &= ~0x1;
|
x2f8_stateFlags &= ~0x1;
|
||||||
x2f8_stateFlags |= 0x6;
|
x2f8_stateFlags |= 0x6;
|
||||||
x318_comboAmmoIdx = 1;
|
x318_comboAmmoIdx = 1;
|
||||||
x31c_missileMode = EMissleMode::Active;
|
x31c_missileMode = EMissileMode::Active;
|
||||||
break;
|
break;
|
||||||
case ENextState::ExitMissile:
|
case ENextState::ExitMissile:
|
||||||
if ((x2f8_stateFlags & 0x8) != 0x8) {
|
if ((x2f8_stateFlags & 0x8) != 0x8) {
|
||||||
|
@ -1883,7 +1881,7 @@ void CPlayerGun::Update(float grappleSwingT, float cameraBobT, float dt, CStateM
|
||||||
x2f8_stateFlags &= 0xFFE9;
|
x2f8_stateFlags &= 0xFFE9;
|
||||||
}
|
}
|
||||||
x318_comboAmmoIdx = 0;
|
x318_comboAmmoIdx = 0;
|
||||||
x31c_missileMode = EMissleMode::Inactive;
|
x31c_missileMode = EMissileMode::Inactive;
|
||||||
x390_cooldown = x72c_currentBeam->GetWeaponInfo().x0_coolDown;
|
x390_cooldown = x72c_currentBeam->GetWeaponInfo().x0_coolDown;
|
||||||
break;
|
break;
|
||||||
case ENextState::MissileReload:
|
case ENextState::MissileReload:
|
||||||
|
@ -1905,7 +1903,7 @@ void CPlayerGun::Update(float grappleSwingT, float cameraBobT, float dt, CStateM
|
||||||
x2f8_stateFlags &= 0xFFE9;
|
x2f8_stateFlags &= 0xFFE9;
|
||||||
}
|
}
|
||||||
x318_comboAmmoIdx = 0;
|
x318_comboAmmoIdx = 0;
|
||||||
x31c_missileMode = EMissleMode::Inactive;
|
x31c_missileMode = EMissileMode::Inactive;
|
||||||
break;
|
break;
|
||||||
case ENextState::EnterPhazonBeam:
|
case ENextState::EnterPhazonBeam:
|
||||||
if (x75c_phazonBeam->IsLoaded())
|
if (x75c_phazonBeam->IsLoaded())
|
||||||
|
@ -1970,7 +1968,7 @@ void CPlayerGun::Update(float grappleSwingT, float cameraBobT, float dt, CStateM
|
||||||
zeus::CAABox aabb = x72c_currentBeam->GetBounds().getTransformedAABox(x4a8_gunWorldXf);
|
zeus::CAABox aabb = x72c_currentBeam->GetBounds().getTransformedAABox(x4a8_gunWorldXf);
|
||||||
mgr.BuildNearList(nearList, aabb, sAimFilter, &player);
|
mgr.BuildNearList(nearList, aabb, sAimFilter, &player);
|
||||||
TUniqueId bestId = kInvalidUniqueId;
|
TUniqueId bestId = kInvalidUniqueId;
|
||||||
zeus::CVector3f dir = x4a8_gunWorldXf.basis[1].normalized();
|
zeus::CVector3f dir = x4a8_gunWorldXf.frontVector().normalized();
|
||||||
zeus::CVector3f pos = dir * -0.5f + x4a8_gunWorldXf.origin;
|
zeus::CVector3f pos = dir * -0.5f + x4a8_gunWorldXf.origin;
|
||||||
CRayCastResult result = mgr.RayWorldIntersection(bestId, pos, dir, 3.5f, sAimFilter, nearList);
|
CRayCastResult result = mgr.RayWorldIntersection(bestId, pos, dir, 3.5f, sAimFilter, nearList);
|
||||||
x833_29_pointBlankWorldSurface = result.IsValid();
|
x833_29_pointBlankWorldSurface = result.IsValid();
|
||||||
|
|
|
@ -35,7 +35,7 @@ struct CFinalInput;
|
||||||
class CPlayerGun {
|
class CPlayerGun {
|
||||||
public:
|
public:
|
||||||
static float skTractorBeamFactor;
|
static float skTractorBeamFactor;
|
||||||
enum class EMissleMode { Inactive, Active };
|
enum class EMissileMode { Inactive, Active };
|
||||||
enum class EBWeapon { Bomb, PowerBomb };
|
enum class EBWeapon { Bomb, PowerBomb };
|
||||||
enum class EPhazonBeamState { Inactive, Entering, Exiting, Active };
|
enum class EPhazonBeamState { Inactive, Entering, Exiting, Active };
|
||||||
enum class EChargePhase {
|
enum class EChargePhase {
|
||||||
|
@ -141,7 +141,7 @@ private:
|
||||||
CPlayerState::EBeamId x310_currentBeam = CPlayerState::EBeamId::Power;
|
CPlayerState::EBeamId x310_currentBeam = CPlayerState::EBeamId::Power;
|
||||||
CPlayerState::EBeamId x314_nextBeam = CPlayerState::EBeamId::Power;
|
CPlayerState::EBeamId x314_nextBeam = CPlayerState::EBeamId::Power;
|
||||||
u32 x318_comboAmmoIdx = 0;
|
u32 x318_comboAmmoIdx = 0;
|
||||||
EMissleMode x31c_missileMode = EMissleMode::Inactive;
|
EMissileMode x31c_missileMode = EMissileMode::Inactive;
|
||||||
CPlayerState::EBeamId x320_currentAuxBeam = CPlayerState::EBeamId::Power;
|
CPlayerState::EBeamId x320_currentAuxBeam = CPlayerState::EBeamId::Power;
|
||||||
EIdleState x324_idleState = EIdleState::Four;
|
EIdleState x324_idleState = EIdleState::Four;
|
||||||
float x328_animSfxPitch = 0.f;
|
float x328_animSfxPitch = 0.f;
|
||||||
|
@ -323,7 +323,7 @@ public:
|
||||||
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&);
|
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&);
|
||||||
void AsyncLoadSuit(CStateManager& mgr);
|
void AsyncLoadSuit(CStateManager& mgr);
|
||||||
void TouchModel(const CStateManager& stateMgr);
|
void TouchModel(const CStateManager& stateMgr);
|
||||||
EMissleMode GetMissleMode() const { return x31c_missileMode; }
|
EMissileMode GetMissleMode() const { return x31c_missileMode; }
|
||||||
bool IsFidgeting() const { return x833_24_notFidgeting; }
|
bool IsFidgeting() const { return x833_24_notFidgeting; }
|
||||||
bool IsCharging() const { return x834_24_charging; }
|
bool IsCharging() const { return x834_24_charging; }
|
||||||
float GetChargeBeamFactor() const { return x340_chargeBeamFactor; }
|
float GetChargeBeamFactor() const { return x340_chargeBeamFactor; }
|
||||||
|
|
|
@ -18,9 +18,10 @@
|
||||||
|
|
||||||
namespace urde {
|
namespace urde {
|
||||||
|
|
||||||
static bool IsMediumOrLarge(CActor& act) {
|
static bool IsMediumOrLarge(const CActor& act) {
|
||||||
if (TCastToConstPtr<CPatterned> pat = act)
|
if (const TCastToConstPtr<CPatterned> pat = act) {
|
||||||
return pat->GetKnockBackController().GetVariant() != EKnockBackVariant::Small;
|
return pat->GetKnockBackController().GetVariant() != EKnockBackVariant::Small;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3323,7 +3323,7 @@ void CPlayer::UpdateAimTargetPrediction(const zeus::CTransform& xf, const CState
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
x9c6_27_aimingAtProjectile = TCastToConstPtr<CGameProjectile>(target.GetPtr());
|
x9c6_27_aimingAtProjectile = TCastToConstPtr<CGameProjectile>(target.GetPtr()).IsValid();
|
||||||
const zeus::CVector3f instantTarget = target->GetAimPosition(mgr, 0.f);
|
const zeus::CVector3f instantTarget = target->GetAimPosition(mgr, 0.f);
|
||||||
const zeus::CVector3f gunToTarget = instantTarget - xf.origin;
|
const zeus::CVector3f gunToTarget = instantTarget - xf.origin;
|
||||||
const float timeToTarget = gunToTarget.magnitude() / x490_gun->GetBeamVelocity();
|
const float timeToTarget = gunToTarget.magnitude() / x490_gun->GetBeamVelocity();
|
||||||
|
@ -5076,7 +5076,7 @@ bool CPlayer::ValidateOrbitTargetIdAndPointer(TUniqueId uid, CStateManager& mgr)
|
||||||
if (uid == kInvalidUniqueId) {
|
if (uid == kInvalidUniqueId) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return TCastToConstPtr<CActor>(mgr.GetObjectById(uid));
|
return TCastToConstPtr<CActor>(mgr.GetObjectById(uid)).IsValid();
|
||||||
}
|
}
|
||||||
|
|
||||||
zeus::CVector3f CPlayer::GetBallPosition() const {
|
zeus::CVector3f CPlayer::GetBallPosition() const {
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "Runtime/CToken.hpp"
|
#include "Runtime/CToken.hpp"
|
||||||
#include "Runtime/RetroTypes.hpp"
|
#include "Runtime/RetroTypes.hpp"
|
||||||
#include "Runtime/rstl.hpp"
|
#include "Runtime/rstl.hpp"
|
||||||
|
#include "Runtime/Collision/CCollidableOBBTreeGroup.hpp"
|
||||||
#include "Runtime/World/CDamageVulnerability.hpp"
|
#include "Runtime/World/CDamageVulnerability.hpp"
|
||||||
#include "Runtime/World/CHealthInfo.hpp"
|
#include "Runtime/World/CHealthInfo.hpp"
|
||||||
#include "Runtime/World/CPhysicsActor.hpp"
|
#include "Runtime/World/CPhysicsActor.hpp"
|
||||||
|
@ -17,8 +18,6 @@
|
||||||
#include <zeus/CVector3f.hpp>
|
#include <zeus/CVector3f.hpp>
|
||||||
|
|
||||||
namespace urde {
|
namespace urde {
|
||||||
class CCollidableOBBTreeGroup;
|
|
||||||
class CCollidableOBBTreeGroupContainer;
|
|
||||||
class CFluidPlane;
|
class CFluidPlane;
|
||||||
|
|
||||||
struct SRiders {
|
struct SRiders {
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
#include "Runtime/World/CAi.hpp"
|
#include "Runtime/World/CAi.hpp"
|
||||||
|
|
||||||
namespace urde {
|
namespace urde {
|
||||||
|
static logvisor::Module Log("urde::CStateMachine");
|
||||||
|
|
||||||
CStateMachine::CStateMachine(CInputStream& in) {
|
CStateMachine::CStateMachine(CInputStream& in) {
|
||||||
CAiTrigger* lastTrig = nullptr;
|
CAiTrigger* lastTrig = nullptr;
|
||||||
u32 stateCount = in.readUint32Big();
|
u32 stateCount = in.readUint32Big();
|
||||||
|
@ -78,10 +80,8 @@ void CStateMachineState::Update(CStateManager& mgr, CAi& ai, float delta) {
|
||||||
if (andPassed && state) {
|
if (andPassed && state) {
|
||||||
x4_state->CallFunc(mgr, ai, EStateMsg::Deactivate, 0.f);
|
x4_state->CallFunc(mgr, ai, EStateMsg::Deactivate, 0.f);
|
||||||
x4_state = state;
|
x4_state = state;
|
||||||
//#ifndef NDEBUG
|
Log.report(logvisor::Info, FMT_STRING("{} {} {} - {} {}"), ai.GetUniqueId(), ai.GetEditorId(), ai.GetName(),
|
||||||
// fmt::print(FMT_STRING("{} {} {} - {} {}\n"), ai.GetUniqueId(), ai.GetEditorId(), ai.GetName(),
|
state->xc_name, int(state - x0_machine->GetStateVector().data()));
|
||||||
// state->xc_name, int(state - x0_machine->GetStateVector().data()));
|
|
||||||
//#endif
|
|
||||||
x8_time = 0.f;
|
x8_time = 0.f;
|
||||||
x18_24_codeTrigger = false;
|
x18_24_codeTrigger = false;
|
||||||
xc_random = mgr.GetActiveRandom()->Float();
|
xc_random = mgr.GetActiveRandom()->Float();
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include "Runtime/Graphics/Shaders/CColoredQuadFilter.hpp"
|
#include "Runtime/Graphics/Shaders/CColoredQuadFilter.hpp"
|
||||||
#include "Runtime/Graphics/Shaders/CTexturedQuadFilter.hpp"
|
#include "Runtime/Graphics/Shaders/CTexturedQuadFilter.hpp"
|
||||||
#include "Runtime/GuiSys/CGuiTextSupport.hpp"
|
#include "Runtime/GuiSys/CGuiTextSupport.hpp"
|
||||||
|
#include "Runtime/GuiSys/CStringTable.hpp"
|
||||||
|
|
||||||
#include <zeus/CTransform.hpp>
|
#include <zeus/CTransform.hpp>
|
||||||
#include <zeus/CVector2f.hpp>
|
#include <zeus/CVector2f.hpp>
|
||||||
|
@ -21,7 +22,6 @@
|
||||||
|
|
||||||
namespace urde {
|
namespace urde {
|
||||||
class CSimplePool;
|
class CSimplePool;
|
||||||
class CStringTable;
|
|
||||||
|
|
||||||
class CWorldTransManager {
|
class CWorldTransManager {
|
||||||
public:
|
public:
|
||||||
|
|
2
hecl
2
hecl
|
@ -1 +1 @@
|
||||||
Subproject commit 95ac3ef77c8a5dfe70f498fdffea5fe92091bd73
|
Subproject commit d1ed2b5d4d4ef1a56097492fe8a57c6911adf708
|
2
hecl-gui
2
hecl-gui
|
@ -1 +1 @@
|
||||||
Subproject commit c66d33b0b2fca695c39d1c0c829489ba67a52f47
|
Subproject commit e5e3713b12f6c6b93cae5ca59b1879f45d498f22
|
2
specter
2
specter
|
@ -1 +1 @@
|
||||||
Subproject commit fc0d79ace7063f24efaeaf8153753855eb3e2b95
|
Subproject commit f54b6e2650711b9872b230d27f15e0e231a5f12d
|
Loading…
Reference in New Issue