some Placement and other HitSensors

This commit is contained in:
shibbo 2020-11-03 05:54:22 -05:00
parent 42b2c69c27
commit fc1545f481
9 changed files with 161 additions and 3 deletions

View File

@ -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'))

View 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
};
}

View File

@ -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
};
};

View 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;
};
};

View 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
};
};

View File

@ -20,6 +20,8 @@ namespace sead
virtual BufferedSafeStringBase<T> operator=(const BufferedSafeStringBase<T> &);
virtual void assureTerminationImpl_() const;
bool format(const char *, ...);
int mBufferSize; // _10
};

View 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;
}
};

View 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++;
}
}
};

View 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];
}
};