mirror of
https://github.com/MonsterDruide1/OdysseyDecomp.git
synced 2024-11-23 13:29:49 +00:00
some Placement and other HitSensors
This commit is contained in:
parent
42b2c69c27
commit
fc1545f481
@ -13,7 +13,7 @@ optimziation = "-O3"
|
||||
|
||||
root = pathlib.Path("compiler")
|
||||
compilerPath = root / "nx/aarch64/bin/clang++.exe"
|
||||
compilerCommand = f"{compilerPath} -x c++ -std=gnu++14 -fno-exceptions -fno-common -fno-short-enums -ffunction-sections -fdata-sections -fPIC -D{gameVersion} -Wall {optimziation} -fomit-frame-pointer -mcpu=cortex-a57+fp+simd+crypto+crc -g -I include -c "
|
||||
compilerCommand = f"{compilerPath} -x c++ -std=gnu++14 -fno-exceptions -fno-common -fno-short-enums -ffunction-sections -fdata-sections -fPIC -D{gameVersion} {optimziation} -fomit-frame-pointer -mcpu=cortex-a57+fp+simd+crypto+crc -g -I include -c "
|
||||
|
||||
source_folder = pathlib.Path('source/')
|
||||
cpp_files = list(source_folder.rglob('*.cpp'))
|
||||
|
36
include/al/actor/Placement.h
Normal file
36
include/al/actor/Placement.h
Normal file
@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
|
||||
#include "al/byaml/ByamlIter.h"
|
||||
#include "sead/seadSafeString.h"
|
||||
|
||||
namespace al
|
||||
{
|
||||
class PlacementInfo
|
||||
{
|
||||
public:
|
||||
PlacementInfo();
|
||||
|
||||
void set(const al::ByamlIter &, const al::ByamlIter &);
|
||||
|
||||
al::ByamlIter _0;
|
||||
al::ByamlIter mZoneIter; // _10
|
||||
};
|
||||
|
||||
class PlacementId
|
||||
{
|
||||
public:
|
||||
PlacementId();
|
||||
PlacementId(const char *, const char *, const char *);
|
||||
|
||||
void set(const al::PlacementInfo &);
|
||||
bool isEqual(const al::PlacementId &) const;
|
||||
static bool isEqual(const al::PlacementId &, const al::PlacementId &);
|
||||
bool isValid() const;
|
||||
bool makeString(sead::BufferedSafeStringBase<char> *) const;
|
||||
|
||||
const char* _0;
|
||||
const char* mUnitConfigName; // _8
|
||||
const char* mID; // _10
|
||||
const char* mCommonID; // _18
|
||||
};
|
||||
}
|
@ -59,7 +59,7 @@ namespace al
|
||||
bool tryConvertIter(al::ByamlIter *, al::ByamlData const *) const;
|
||||
bool isEqualData(al::ByamlIter const&) const;
|
||||
|
||||
const unsigned char* mData; // _0
|
||||
const unsigned long mDataOffset; // _8
|
||||
unsigned char* mData; // _0
|
||||
unsigned long mDataOffset; // _8
|
||||
};
|
||||
};
|
30
include/al/sensor/HitSensor.h
Normal file
30
include/al/sensor/HitSensor.h
Normal file
@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include "al/actor/LiveActor.h"
|
||||
#include "sead/seadVector.h"
|
||||
|
||||
namespace al
|
||||
{
|
||||
class HitSensor
|
||||
{
|
||||
public:
|
||||
|
||||
void update();
|
||||
void addHitSensor(al::HitSensor *);
|
||||
|
||||
const char* mName; // _0
|
||||
int _8;
|
||||
int _C;
|
||||
unsigned long _10;
|
||||
float _18;
|
||||
unsigned short mMaxSensorCount; // _1C
|
||||
short mSensorCount; // _1E
|
||||
al::HitSensor** mSensors; // _20
|
||||
unsigned long _28;
|
||||
unsigned long _30;
|
||||
unsigned long _38;
|
||||
al::LiveActor* mParentActor; // _40
|
||||
unsigned long _48;
|
||||
sead::Vector3<float>* _50;
|
||||
};
|
||||
};
|
20
include/al/sensor/SensorHitGroup.h
Normal file
20
include/al/sensor/SensorHitGroup.h
Normal file
@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
namespace al
|
||||
{
|
||||
class HitSensor;
|
||||
|
||||
class SensorHitGroup
|
||||
{
|
||||
public:
|
||||
SensorHitGroup(int, const char *);
|
||||
|
||||
void add(al::HitSensor *);
|
||||
void remove(al::HitSensor *);
|
||||
al::HitSensor* getSensor(int) const;
|
||||
|
||||
int _0;
|
||||
int mSensorCount; // _4
|
||||
al::HitSensor** mSensors; // _8
|
||||
};
|
||||
};
|
@ -20,6 +20,8 @@ namespace sead
|
||||
virtual BufferedSafeStringBase<T> operator=(const BufferedSafeStringBase<T> &);
|
||||
virtual void assureTerminationImpl_() const;
|
||||
|
||||
bool format(const char *, ...);
|
||||
|
||||
int mBufferSize; // _10
|
||||
};
|
||||
|
||||
|
41
source/al/actor/Placement.cpp
Normal file
41
source/al/actor/Placement.cpp
Normal file
@ -0,0 +1,41 @@
|
||||
#include "al/actor/Placement.h"
|
||||
|
||||
namespace al
|
||||
{
|
||||
PlacementInfo::PlacementInfo()
|
||||
: _0(), mZoneIter()
|
||||
{ }
|
||||
|
||||
void PlacementInfo::set(const al::ByamlIter &r_0, const al::ByamlIter &rZoneIter)
|
||||
{
|
||||
_0.mDataOffset = r_0.mDataOffset;
|
||||
_0.mData = r_0.mData;
|
||||
|
||||
mZoneIter.mDataOffset = rZoneIter.mDataOffset;
|
||||
mZoneIter.mData = rZoneIter.mData;
|
||||
}
|
||||
|
||||
PlacementId::PlacementId()
|
||||
: mID(nullptr), mCommonID(nullptr), _0(nullptr), mUnitConfigName(nullptr)
|
||||
{ }
|
||||
|
||||
PlacementId::PlacementId(const char *p_0, const char *pUnitConfig, const char *pID)
|
||||
: _0(p_0), mUnitConfigName(pUnitConfig), mID(pID), mCommonID(nullptr)
|
||||
{ }
|
||||
|
||||
bool PlacementId::isValid() const
|
||||
{
|
||||
bool ret;
|
||||
|
||||
if (mCommonID)
|
||||
{
|
||||
ret = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = _0 != nullptr;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
};
|
13
source/al/sensor/HitSensor.cpp
Normal file
13
source/al/sensor/HitSensor.cpp
Normal file
@ -0,0 +1,13 @@
|
||||
#include "al/sensor/HitSensor.h"
|
||||
|
||||
namespace al
|
||||
{
|
||||
void HitSensor::addHitSensor(al::HitSensor *pSensor)
|
||||
{
|
||||
if (mSensorCount < mMaxSensorCount)
|
||||
{
|
||||
mSensors[mSensorCount] = pSensor;
|
||||
mSensorCount++;
|
||||
}
|
||||
}
|
||||
};
|
16
source/al/sensor/SensorHitGroup.cpp
Normal file
16
source/al/sensor/SensorHitGroup.cpp
Normal file
@ -0,0 +1,16 @@
|
||||
#include "al/sensor/SensorHitGroup.h"
|
||||
|
||||
namespace al
|
||||
{
|
||||
void SensorHitGroup::add(al::HitSensor *pSensor)
|
||||
{
|
||||
// todo -- fix incrementation issue
|
||||
mSensors[mSensorCount] = pSensor;
|
||||
++mSensorCount;
|
||||
}
|
||||
|
||||
al::HitSensor* SensorHitGroup::getSensor(int idx) const
|
||||
{
|
||||
return mSensors[idx];
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue
Block a user