Minor cleanups

This commit is contained in:
Phillip Stephens 2022-01-30 12:07:24 -08:00
parent 91996ab561
commit a491e2e9f2
Signed by: Antidote
GPG Key ID: F8BEE4C83DACA60D
8 changed files with 21 additions and 22 deletions

View File

@ -108,7 +108,7 @@ void SCLY::ScriptLayer::Enumerate<BigDNA::Read>(athena::io::IStreamReader& rs) {
[&type](const ScriptObjectSpec* obj) -> bool { return obj->type == type; });
if (iter != SCRIPT_OBJECT_DB.end()) {
std::unique_ptr<IScriptObject> obj((*iter)->a());
std::unique_ptr<IScriptObject> obj((*iter)->loader());
obj->type = type;
obj->read(rs);
objects.push_back(std::move(obj));
@ -141,7 +141,7 @@ void SCLY::ScriptLayer::Enumerate<BigDNA::ReadYaml>(athena::io::YAMLDocReader& r
[&type](const ScriptObjectSpec* obj) -> bool { return obj->type == type; });
if (iter != SCRIPT_OBJECT_DB.end()) {
std::unique_ptr<IScriptObject> obj((*iter)->a());
std::unique_ptr<IScriptObject> obj((*iter)->loader());
obj->read(rs);
obj->type = type;
objects.push_back(std::move(obj));

View File

@ -10,12 +10,12 @@ struct MazeNode : IScriptObject {
String<-1> name;
Value<atVec3f> location;
Value<atVec3f> orientation;
Value<bool> unknown1;
Value<atUint32> unknown2;
Value<atUint32> unknown3;
Value<atUint32> unknown4;
Value<atVec3f> unknown5;
Value<atVec3f> unknown6;
Value<atVec3f> unknown7;
Value<bool> active;
Value<atUint32> col;
Value<atUint32> row;
Value<atUint32> side;
Value<atVec3f> actorPos;
Value<atVec3f> triggerPos;
Value<atVec3f> effectPos;
};
} // namespace DataSpec::DNAMP1

View File

@ -9,7 +9,7 @@ struct IScriptObject;
struct ScriptObjectSpec {
atUint8 type;
IScriptObject* (*a)();
IScriptObject* (*loader)();
};
using ScriptObjectDBArray = std::array<const ScriptObjectSpec*, 127>;

View File

@ -34,6 +34,7 @@ public:
static OSTime ToWiiTime(std::chrono::system_clock::time_point time);
static std::chrono::system_clock::time_point FromWiiTime(OSTime wiiTime);
static OSTime GetTime() { return ToWiiTime(std::chrono::system_clock::now()); }
static u64 GetGCTicks();
static constexpr u64 GetGCTicksPerSec() { return 486000000ull; }

View File

@ -221,7 +221,7 @@ void CGameState::PutTo(CBitStreamWriter& writer) {
writer.WriteEncoded(u32(value), 8);
}
writer.WriteEncoded(CBasics::ToWiiTime(std::chrono::system_clock::now()) / CBasics::TICKS_PER_SECOND, 32);
writer.WriteEncoded(CBasics::GetTime() / CBasics::TICKS_PER_SECOND, 32);
writer.WriteEncoded(x228_24_hardMode, 1);
writer.WriteEncoded(x228_25_initPowerupsAtFirstSpawn, 1);
writer.WriteEncoded(u32(x84_mlvlId.Value()), 32);

View File

@ -1,8 +1,6 @@
#include "Runtime/World/CPlayerCameraBob.hpp"
#include "Runtime/CStateManager.hpp"
#include "Runtime/Camera/CCameraManager.hpp"
#include "Runtime/Particle/CGenDescription.hpp"
#include "Runtime/World/CPlayer.hpp"
#include <zeus/Math.hpp>

View File

@ -4,9 +4,9 @@
#include "Runtime/CToken.hpp"
#include "Runtime/GCNTypes.hpp"
#include "Runtime/IOStreams.hpp"
#include "Runtime/IObj.hpp"
#include "Runtime/IObjFactory.hpp"
#include "Runtime/IOStreams.hpp"
#include "Runtime/World/CAiFuncMap.hpp"
namespace metaforce {

View File

@ -3760,15 +3760,15 @@ CEntity* ScriptLoader::LoadMazeNode(CStateManager& mgr, CInputStream& in, int pr
SActorHead aHead = LoadActorHead(in, mgr);
bool active = in.readBool();
u32 w1 = in.readUint32Big();
u32 w2 = in.readUint32Big();
u32 w3 = in.readUint32Big();
zeus::CVector3f vec1 = zeus::CVector3f::ReadBig(in);
zeus::CVector3f vec2 = zeus::CVector3f::ReadBig(in);
zeus::CVector3f vec3 = zeus::CVector3f::ReadBig(in);
u32 col = in.readUint32Big();
u32 row = in.readUint32Big();
u32 side = in.readUint32Big();
zeus::CVector3f actorPos = zeus::CVector3f::ReadBig(in);
zeus::CVector3f triggerPos = zeus::CVector3f::ReadBig(in);
zeus::CVector3f effectPos = zeus::CVector3f::ReadBig(in);
return new CScriptMazeNode(mgr.AllocateUniqueId(), aHead.x0_name, info, aHead.x10_transform, active, w1, w2, w3, vec1,
vec2, vec3);
return new CScriptMazeNode(mgr.AllocateUniqueId(), aHead.x0_name, info, aHead.x10_transform, active, col, row, side,
actorPos, triggerPos, effectPos);
}
CEntity* ScriptLoader::LoadOmegaPirate(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info) {