Skip to content

Commit

Permalink
Various minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Antidote committed Jan 22, 2023
1 parent 292e655 commit 763fcdb
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 7 deletions.
3 changes: 1 addition & 2 deletions Runtime/CMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion Runtime/ConsoleVariables/CVarManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,14 +294,18 @@ 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 */
oldDeveloper = com_developer->toBoolean();
} 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)));
}
}

Expand Down
3 changes: 2 additions & 1 deletion Runtime/ConsoleVariables/CVarManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <memory>
#include <string>
#include <unordered_map>
#include <map>
#include <vector>

#include "Runtime/ConsoleVariables/CVar.hpp"
Expand Down Expand Up @@ -109,7 +110,7 @@ class CVarManager final {
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;
};

Expand Down
2 changes: 1 addition & 1 deletion Runtime/Input/RumbleFxTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 25 additions & 1 deletion Runtime/MP1/World/CMetroidPrimeProjectile.cpp
Original file line number Diff line number Diff line change
@@ -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 {

Expand Down Expand Up @@ -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
12 changes: 12 additions & 0 deletions Runtime/MP1/World/CMetroidPrimeProjectile.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -31,6 +40,9 @@ class CMetroidPrimeProjectile : public CEnergyProjectile {
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 changes: 1 addition & 1 deletion extern/aurora

0 comments on commit 763fcdb

Please sign in to comment.