Various minor fixes

This commit is contained in:
Phillip Stephens 2023-01-22 14:22:28 -08:00
parent 292e655737
commit 763fcdbd9c
7 changed files with 47 additions and 7 deletions

View File

@ -490,10 +490,9 @@ int main(int argc, char** argv) {
do {
metaforce::CVarManager cvarMgr{fileMgr};
metaforce::CVarCommons cvarCmns{cvarMgr};
cvarMgr.parseCommandLine(args);
if (!restart) {
cvarMgr.parseCommandLine(args);
// TODO add clear loggers func to logvisor so we can recreate loggers on restart
bool logging = IsClientLoggingEnabled(argc, argv);
#if _WIN32

View File

@ -294,6 +294,7 @@ void CVarManager::parseCommandLine(const std::vector<std::string>& args) {
cv->fromLiteralToType(cvarValue);
}
cv->m_wasDeserialized = true;
cv->forceClearModified();
CStringExtras::ToLower(cvarName);
if (developerName == cvarName)
/* Make sure we're not overriding developer mode when we restore */
@ -301,7 +302,10 @@ void CVarManager::parseCommandLine(const std::vector<std::string>& args) {
} else {
/* Unable to find an existing CVar, let's defer for the time being 8 */
CStringExtras::ToLower(cvarName);
m_deferedCVars.insert_or_assign(std::move(cvarName), std::move(cvarValue));
if (cvarValue.empty()) {
cvarValue = "true";
}
m_deferedCVars.insert(std::make_pair<std::string, std::string>(std::move(cvarName), std::move(cvarValue)));
}
}

View File

@ -3,6 +3,7 @@
#include <memory>
#include <string>
#include <unordered_map>
#include <map>
#include <vector>
#include "Runtime/ConsoleVariables/CVar.hpp"
@ -109,7 +110,7 @@ private:
void restoreDeveloper(bool oldDeveloper);
std::unordered_map<std::string, std::unique_ptr<CVar>> m_cvars;
std::unordered_map<std::string, std::string> m_deferedCVars;
std::map<std::string, std::string> m_deferedCVars;
std::vector<StoreCVar::CVar> loadCVars(const std::string& filename) const;
};

View File

@ -15,7 +15,7 @@ constexpr RumbleFXTable RumbleFxTable{{
{0.48f, 0.f, 0.065f, 0.175f, 0.4f, 0.0f, false, false},
{0.72f, 0.f, 0.01f, 0.01f, 0.6f, 0.1f, false, false},
{0.24f, 0.f, 0.01f, 0.525f, 0.2f, 0.2f, false, false},
{2.4f, 0.f, 0.01f, 0.466f, 0.f, 0.f, false, false}, // PlayerBump
{2.4f, 0.f, 0.01f, 0.466f, 0.f, 0.f, false, false}, // PlayerBump
{0.5532f, 0.f, 0.f, 1.345f, 0.f, 1.756f, false, false}, // PlayerGunCharge
{2.4f, 0.f, 0.01f, 0.125f, 0.25f, 0.5f, false, false}, // PlayerMissileFire
{0.84f, 0.f, 0.1f, 0.125f, 0.35f, 1.0f, false, false}, // PlayerGrappleFire

View File

@ -1,7 +1,8 @@
#include "Runtime/MP1/World/CMetroidPrimeProjectile.hpp"
#include "Runtime/World/CFire.hpp"
#include "Runtime/CSimplePool.hpp"
#include "Runtime/GameGlobalObjects.hpp"
#include "Runtime/CStateManager.hpp"
namespace metaforce::MP1 {
@ -30,4 +31,27 @@ CMetroidPrimeProjectile::CMetroidPrimeProjectile(bool active, const TToken<CWeap
visorParticle, visorSfx, sendCollideMsg)
, x3d8_auxData(auxData) {}
bool CMetroidPrimeProjectile::Explode(const zeus::CVector3f& pos, const zeus::CVector3f& normal,
const EWeaponCollisionResponseTypes type, CStateManager& mgr,
const CDamageVulnerability& dVuln, TUniqueId hitActor) {
bool result = CEnergyProjectile::Explode(pos, normal, type, mgr, dVuln, hitActor);
if (!x2e4_24_active) {
TUniqueId newId(mgr.AllocateUniqueId());
zeus::CAABox box = zeus::CAABox(zeus::CVector3f(-1.f, -1.f, -1.f), zeus::CVector3f(1.f, 1.f, 1.f))
.getTransformedAABox(GetTransform() *
zeus::CTransform::Scale(x3d8_auxData.GetDamageInfo().GetRadius()));
CFire* fire = new CFire(x3d8_auxData.x4_particle, newId, GetAreaIdAlways(), true, GetUniqueId(), GetTransform(),
x3d8_auxData.GetDamageInfo(), box, zeus::CVector3f(1.f, 1.f, 1.f),
x3d8_auxData.GetFlag_27(), x3d8_auxData.GetTexture(), x3d8_auxData.GetFlag_24(),
x3d8_auxData.GetFlag_25(), x3d8_auxData.GetFlag_26(), 1.0, x3d8_auxData.Get_0x28(),
x3d8_auxData.Get_0x2c(), x3d8_auxData.Get_0x30());
if (fire) {
mgr.AddObject(fire);
}
}
return result;
}
} // namespace metaforce::MP1

View File

@ -18,6 +18,15 @@ struct SPrimeProjectileInfo {
bool x38_26_ : 1;
bool x38_27_ : 1;
explicit SPrimeProjectileInfo(CInputStream& in);
const CDamageInfo& GetDamageInfo() const { return xc_dInfo; }
float Get_0x28() const { return x28_; }
float Get_0x2c() const { return x2c_; }
float Get_0x30() const { return x30_; }
CAssetId GetTexture() const { return x34_texture; }
const bool GetFlag_24() const { return x38_24_; }
const bool GetFlag_25() const { return x38_25_; }
const bool GetFlag_26() const { return x38_26_; }
const bool GetFlag_27() const { return x38_27_; }
};
class CMetroidPrimeProjectile : public CEnergyProjectile {
@ -31,6 +40,9 @@ public:
TUniqueId homingTarget, EProjectileAttrib attribs, const zeus::CVector3f& scale,
const std::optional<TLockedToken<CGenDescription>>& visorParticle, u16 visorSfx,
bool sendCollideMsg);
bool Explode(const zeus::CVector3f& pos, const zeus::CVector3f& normal, const EWeaponCollisionResponseTypes type,
CStateManager& mgr, const CDamageVulnerability& dVuln, TUniqueId hitActor) override;
};
} // namespace metaforce::MP1

2
extern/aurora vendored

@ -1 +1 @@
Subproject commit b91c2739c9bff672355daf3bf6daa4d8813a52ba
Subproject commit ca822a7679bd0589ce8243f0138054085e3cabd6