mirror of https://github.com/zeldaret/botw.git
ksys/evt: Fix some function signatures
This commit is contained in:
parent
9d81c0645f
commit
db6d210a53
|
|
@ -75585,12 +75585,12 @@
|
|||
0x0000007100db3ffc,evt::Event::doAssign,296,
|
||||
0x0000007100db4124,evt::Event::assign,48,
|
||||
0x0000007100db4154,sub_7100DB4154,1680,
|
||||
0x0000007100db47e4,ksys::evt::OrderParam::ctor,36,_ZN4ksys3evt10OrderParamC1EPN4sead7ExpHeapE
|
||||
0x0000007100db47e4,ksys::evt::OrderParam::ctor,36,_ZN4ksys3evt10OrderParamC1EPN4sead4HeapE
|
||||
0x0000007100db4808,ksys::evt::OrderParam::dtor,20,_ZN4ksys3evt10OrderParamD1Ev
|
||||
0x0000007100db481c,ksys::evt::OrderParam::uninitialize,284,_ZN4ksys3evt10OrderParam12uninitializeEv
|
||||
0x0000007100db4938,ksys::evt::OrderParam::dtorDelete,52,_ZN4ksys3evt10OrderParamD0Ev
|
||||
0x0000007100db496c,ksys::evt::OrderParam::doAssign,1160,_ZN4ksys3evt10OrderParam8doAssignEPS1_
|
||||
0x0000007100db4df4,ksys::evt::OrderParam::assign,48,_ZN4ksys3evt10OrderParam6assignEPS1_
|
||||
0x0000007100db496c,ksys::evt::OrderParam::doAssign,1160,_ZN4ksys3evt10OrderParam8doAssignERKS1_
|
||||
0x0000007100db4df4,ksys::evt::OrderParam::assign,48,_ZN4ksys3evt10OrderParamaSERKS1_
|
||||
0x0000007100db4e24,ksys::evt::OrderParam::initialize,332,_ZN4ksys3evt10OrderParam10initializeEi
|
||||
0x0000007100db4f70,ksys::evt::OrderParam::addParamInt,220,_ZN4ksys3evt10OrderParam11addParamIntEiRKN4sead14SafeStringBaseIcEE
|
||||
0x0000007100db504c,ksys::evt::OrderParam::addParamString,412,_ZN4ksys3evt10OrderParam14addParamStringERKN4sead14SafeStringBaseIcEES6_
|
||||
|
|
|
|||
|
Can't render this file because it is too large.
|
|
|
@ -1,5 +1,4 @@
|
|||
#include "KingSystem/Event/evtOrderParam.h"
|
||||
#include <basis/seadTypes.h>
|
||||
#include <codec/seadHashCRC32.h>
|
||||
#include <container/seadBuffer.h>
|
||||
#include <heap/seadExpHeap.h>
|
||||
|
|
@ -8,7 +7,7 @@
|
|||
|
||||
namespace ksys::evt {
|
||||
|
||||
OrderParam::OrderParam(sead::ExpHeap* heap) {
|
||||
OrderParam::OrderParam(sead::Heap* heap) {
|
||||
mHeap = heap;
|
||||
}
|
||||
|
||||
|
|
@ -77,26 +76,28 @@ const OrderParamEntry* OrderParam::getParam(const s32 index) const {
|
|||
sead::FixedSafeString<0x100> error_message;
|
||||
|
||||
error_message.format("[%s] getParam(%d) is failed.", "ksys::evt::OrderParam", index);
|
||||
if ((u32)std::max(0, mEntries.size()) > (u32)index) {
|
||||
if (u32(std::max(0, mEntries.size())) > u32(index)) {
|
||||
return &mEntries[index];
|
||||
} else {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
OrderParam* OrderParam::assign(OrderParam* other) {
|
||||
if (this != other) {
|
||||
|
||||
OrderParam& OrderParam::operator=(const OrderParam& other) {
|
||||
if (this != &other) {
|
||||
doAssign(other);
|
||||
}
|
||||
return this;
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool OrderParam::doAssign(OrderParam* other) {
|
||||
if (this == other)
|
||||
bool OrderParam::doAssign(const OrderParam& other) {
|
||||
if (this == &other)
|
||||
return true;
|
||||
if (!initialize(std::max(0, other->mEntries.size())))
|
||||
|
||||
if (!initialize(std::max(0, other.mEntries.size())))
|
||||
return false;
|
||||
for (s32 i = 0; i < mEntries.size(); i++) {
|
||||
auto* other_entry = other->getParam(i);
|
||||
auto* other_entry = other.getParam(i);
|
||||
if (other_entry) {
|
||||
auto* other_ptr = other_entry->data;
|
||||
auto* other_name = other_entry->name;
|
||||
|
|
|
|||
|
|
@ -27,15 +27,15 @@ struct OrderParamEntry {
|
|||
};
|
||||
|
||||
class OrderParam {
|
||||
OrderParam(sead::ExpHeap* heap);
|
||||
virtual ~OrderParam();
|
||||
|
||||
public:
|
||||
explicit OrderParam(sead::Heap* heap);
|
||||
OrderParam(const OrderParam& other) { *this = other; }
|
||||
virtual ~OrderParam();
|
||||
OrderParam& operator=(const OrderParam& other);
|
||||
bool initialize(s32 entry_count);
|
||||
void uninitialize();
|
||||
OrderParam* assign(OrderParam* other);
|
||||
|
||||
inline const OrderParamEntry* getParam(const s32 index) const;
|
||||
const OrderParamEntry* getParam(s32 index) const;
|
||||
bool addParamInt(s32 val, const sead::SafeString& name);
|
||||
bool addParamFloat(f32 val, const sead::SafeString& name);
|
||||
bool addParamString(const sead::SafeString& val, const sead::SafeString& name);
|
||||
|
|
@ -49,7 +49,8 @@ public:
|
|||
bool getArrayByName(const sead::SafeString& name, void** out_ptr, u32* out_size);
|
||||
|
||||
private:
|
||||
bool doAssign(OrderParam* other);
|
||||
bool doAssign(const OrderParam& other);
|
||||
|
||||
OrderParamEntry* getFreeEntry();
|
||||
void* getPointerByName(const sead::SafeString& name, OrderParamType type,
|
||||
u32* out_size = nullptr) const;
|
||||
|
|
@ -84,7 +85,7 @@ private:
|
|||
e->data = nullptr;
|
||||
}
|
||||
|
||||
sead::ExpHeap* mHeap;
|
||||
sead::Heap* mHeap;
|
||||
sead::Buffer<OrderParamEntry> mEntries;
|
||||
u32 mEntryCount = 0;
|
||||
bool mInitialized = false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue