mirror of
https://github.com/zeldaret/tp
synced 2026-07-07 14:13:27 -04:00
JStudio debug improvements (#2902)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#ifndef BINARY_H
|
||||
#define BINARY_H
|
||||
|
||||
#include "JSystem/JUtility/JUTAssert.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "JSystem/JGadget/search.h"
|
||||
|
||||
@@ -14,7 +15,12 @@ struct TEBit {
|
||||
const void* parseVariableUInt_16_32_following(const void* pu16, u32* pu32First, u32* pu32Second,
|
||||
TEBit* tebit);
|
||||
|
||||
inline bool isPower2(unsigned int arg0) {
|
||||
return arg0 != 0 && (arg0 & arg0 - 1) == 0;
|
||||
}
|
||||
|
||||
inline u32 align_roundUp(unsigned int arg0, unsigned int uAlign) {
|
||||
JUT_ASSERT(98, isPower2(uAlign));
|
||||
return (arg0 + uAlign - 1) & ~(uAlign - 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -235,7 +235,7 @@ struct TLinkList : TNodeLinkList {
|
||||
iterator end() { return iterator(TNodeLinkList::end()); }
|
||||
const_iterator end() const { return const_iterator(const_cast<TLinkList*>(this)->end()); }
|
||||
T& front() { return *begin(); }
|
||||
T& back() { return *--end(); }
|
||||
T& back() { JUT_ASSERT(652, !empty()); return *--end(); }
|
||||
void pop_front() { erase(TNodeLinkList::begin()); }
|
||||
void Push_front(T* element) { Insert(begin(), element); }
|
||||
void Push_back(T* element) { Insert(end(), element); }
|
||||
|
||||
@@ -51,7 +51,7 @@ struct TVector_pointer_void : TVector<void*, TAllocator> {
|
||||
void insert(void**, void* const&);
|
||||
|
||||
void clear() { erase(begin(), end()); }
|
||||
void push_back(const void*& ref) { insert(end(), (void* const&)ref); }
|
||||
void push_back(void* const& ref) { insert(end(), ref); }
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
@@ -66,7 +66,7 @@ struct TVector_pointer : TVector_pointer_void {
|
||||
T* end() { return (T*)TVector_pointer_void::end(); }
|
||||
|
||||
void push_back(const T& ref) {
|
||||
static_cast<TVector_pointer_void*>(this)->push_back((const void*&)ref);
|
||||
static_cast<TVector_pointer_void*>(this)->push_back(ref);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -55,8 +55,7 @@ struct data {
|
||||
}
|
||||
|
||||
const void* getContent() const {
|
||||
const THeaderData* header = (THeaderData*) getRaw();
|
||||
return header->content;
|
||||
return ((THeaderData*) getRaw())->content;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -86,7 +85,7 @@ struct data {
|
||||
}
|
||||
|
||||
const void* getBlockEnd_() const {
|
||||
return get()->field_0x8;
|
||||
return ((const TBlockData*)getRaw())->field_0x8;
|
||||
}
|
||||
|
||||
const void* get_ID() const {
|
||||
@@ -134,11 +133,11 @@ struct TControl {
|
||||
JStudio::ctb::TObject* getObject(void const*, u32);
|
||||
JStudio::ctb::TObject* getObject_index(u32);
|
||||
|
||||
TFactory* getFactory() { return pFactory_; }
|
||||
TFactory* getFactory() const { return pFactory_; }
|
||||
void setFactory(TFactory* factory) { pFactory_ = factory; }
|
||||
|
||||
/* 0x4 */ TFactory* pFactory_;
|
||||
/* 0x8 */ JGadget::TLinkList<TObject, -12> mList;
|
||||
/* 0x8 */ JGadget::TLinkList<TObject, -12> ocObject_;
|
||||
};
|
||||
|
||||
struct TParse : public JGadget::binary::TParse_header_block {
|
||||
|
||||
@@ -545,7 +545,7 @@ inline f64 extrapolateParameter_clamp(f64 value, f64 max) {
|
||||
return 0.0;
|
||||
|
||||
if (max <= value)
|
||||
value = max;
|
||||
return max;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -142,31 +142,31 @@ public:
|
||||
*pDst = rSrc;
|
||||
}
|
||||
|
||||
void transformOnSet_transform(TTransform_position* param_1, TTransform_position* param_2) const {
|
||||
transformOnSet_transformTranslation(*param_1, param_2);
|
||||
void transformOnSet_transform(const TTransform_position ¶m_1, TTransform_position* param_2) const {
|
||||
transformOnSet_transformTranslation(param_1, param_2);
|
||||
}
|
||||
|
||||
void transformOnSet_transform(TTransform_translation_rotation_scaling* param_1,
|
||||
void transformOnSet_transform(const TTransform_translation_rotation_scaling& param_1,
|
||||
TTransform_translation_rotation_scaling* param_2) const {
|
||||
transformOnSet_transformTranslation(param_1->translation, ¶m_2->translation);
|
||||
transformOnSet_transformRotation(param_1->rotation, ¶m_2->rotation);
|
||||
transformOnSet_transformScaling(param_1->scaling, ¶m_2->scaling);
|
||||
transformOnSet_transformTranslation(param_1.translation, ¶m_2->translation);
|
||||
transformOnSet_transformRotation(param_1.rotation, ¶m_2->rotation);
|
||||
transformOnSet_transformScaling(param_1.scaling, ¶m_2->scaling);
|
||||
}
|
||||
|
||||
TTransform_position* transformOnSet_transform_ifEnabled(TTransform_position* param_1,
|
||||
const TTransform_position* transformOnSet_transform_ifEnabled(const TTransform_position& param_1,
|
||||
TTransform_position* param_2) const {
|
||||
if (!transformOnSet_isEnabled()) {
|
||||
return param_1;
|
||||
return ¶m_1;
|
||||
}
|
||||
transformOnSet_transform(param_1, param_2);
|
||||
return param_2;
|
||||
}
|
||||
|
||||
TTransform_translation_rotation_scaling*
|
||||
transformOnSet_transform_ifEnabled(TTransform_translation_rotation_scaling* param_1,
|
||||
const TTransform_translation_rotation_scaling*
|
||||
transformOnSet_transform_ifEnabled(const TTransform_translation_rotation_scaling& param_1,
|
||||
TTransform_translation_rotation_scaling* param_2) const {
|
||||
if (!transformOnSet_isEnabled()) {
|
||||
return param_1;
|
||||
return ¶m_1;
|
||||
}
|
||||
transformOnSet_transform(param_1, param_2);
|
||||
return param_2;
|
||||
@@ -187,33 +187,33 @@ public:
|
||||
MTXMultVecSR(transformOnGet_getMatrix(), &rSrc, pDst);
|
||||
}
|
||||
|
||||
void transformOnGet_transform(TTransform_position_direction* param_1,
|
||||
void transformOnGet_transform(const TTransform_position_direction& param_1,
|
||||
TTransform_position_direction* pDst) const {
|
||||
JUT_ASSERT(289, pDst!=NULL);
|
||||
transformOnGet_transformTranslation(param_1->position, &pDst->position);
|
||||
transformOnGet_transformDirection(param_1->direction, &pDst->direction);
|
||||
transformOnGet_transformTranslation(param_1.position, &pDst->position);
|
||||
transformOnGet_transformDirection(param_1.direction, &pDst->direction);
|
||||
}
|
||||
|
||||
TTransform_position_direction*
|
||||
transformOnGet_transform_ifEnabled(TTransform_position_direction& param_1,
|
||||
const TTransform_position_direction*
|
||||
transformOnGet_transform_ifEnabled(const TTransform_position_direction& param_1,
|
||||
TTransform_position_direction* param_2) const {
|
||||
if (!transformOnGet_isEnabled()) {
|
||||
return ¶m_1;
|
||||
}
|
||||
transformOnGet_transform(¶m_1, param_2);
|
||||
transformOnGet_transform(param_1, param_2);
|
||||
return param_2;
|
||||
}
|
||||
|
||||
void transformOnGet_transform(TTransform_position* param_1,
|
||||
void transformOnGet_transform(const TTransform_position& param_1,
|
||||
TTransform_position* pDst) const {
|
||||
transformOnGet_transformTranslation(*param_1, pDst);
|
||||
transformOnGet_transformTranslation(param_1, pDst);
|
||||
}
|
||||
|
||||
TTransform_position*
|
||||
transformOnGet_transform_ifEnabled(TTransform_position* param_1,
|
||||
const TTransform_position*
|
||||
transformOnGet_transform_ifEnabled(const TTransform_position& param_1,
|
||||
TTransform_position* param_2) const {
|
||||
if (!transformOnGet_isEnabled()) {
|
||||
return param_1;
|
||||
return ¶m_1;
|
||||
}
|
||||
transformOnGet_transform(param_1, param_2);
|
||||
return param_2;
|
||||
@@ -257,18 +257,18 @@ public:
|
||||
MTXMultVecSR(transformOnSet_getMatrix(), &rSrc, pDst);
|
||||
}
|
||||
|
||||
void transformOnSet_transform(TTransform_position_direction* param_1,
|
||||
void transformOnSet_transform(const TTransform_position_direction& param_1,
|
||||
TTransform_position_direction* pDst) const {
|
||||
JUT_ASSERT(219, pDst!=NULL);
|
||||
transformOnSet_transformTranslation(param_1->position, &pDst->position);
|
||||
transformOnSet_transformDirection(param_1->direction, &pDst->direction);
|
||||
transformOnSet_transformTranslation(param_1.position, &pDst->position);
|
||||
transformOnSet_transformDirection(param_1.direction, &pDst->direction);
|
||||
}
|
||||
|
||||
TTransform_position_direction*
|
||||
transformOnSet_transform_ifEnabled(TTransform_position_direction* param_1,
|
||||
const TTransform_position_direction*
|
||||
transformOnSet_transform_ifEnabled(const TTransform_position_direction& param_1,
|
||||
TTransform_position_direction* param_2) const {
|
||||
if (!transformOnSet_isEnabled()) {
|
||||
return param_1;
|
||||
return ¶m_1;
|
||||
}
|
||||
transformOnSet_transform(param_1, param_2);
|
||||
return param_2;
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace object {
|
||||
|
||||
struct TIDData {
|
||||
public:
|
||||
TIDData(const void* id, u32 id_size) : mID(id), mID_size(id_size) {}
|
||||
TIDData(const void* pID, u32 uIDSize_) : mID(pID), mID_size(uIDSize_) {}
|
||||
|
||||
static bool isEqual(JStudio::object::TIDData const&, JStudio::object::TIDData const&);
|
||||
inline const u8* getID() const { return (const u8*)mID; }
|
||||
@@ -20,17 +20,21 @@ protected:
|
||||
/* 0x04 */ u32 mID_size;
|
||||
};
|
||||
|
||||
struct TObject_ID : public TIDData {
|
||||
TObject_ID(const void* id, u32 id_size) : TIDData(id, id_size) {}
|
||||
struct TObject_ID {
|
||||
TObject_ID(const void* id, u32 id_size) : mData(id, id_size) {}
|
||||
~TObject_ID() {}
|
||||
TIDData const& getIDData() const { return *this; }
|
||||
const u8 *getID() const { return TIDData::getID(); }
|
||||
TIDData const& getIDData() const { return mData; }
|
||||
const u8 *getID() const { return mData.getID(); }
|
||||
|
||||
TIDData mData;
|
||||
};
|
||||
|
||||
struct TPRObject_ID_equal : public TIDData {
|
||||
TPRObject_ID_equal(const void* id, u32 id_size) : TIDData(id, id_size) {}
|
||||
struct TPRObject_ID_equal {
|
||||
TPRObject_ID_equal(const void* id, u32 id_size) : mData(id, id_size) {}
|
||||
~TPRObject_ID_equal() {}
|
||||
bool operator()(TObject_ID const& id) const { return TIDData::isEqual(id.getIDData(), *this); }
|
||||
bool operator()(TObject_ID const& id) const { return TIDData::isEqual(id.getIDData(), mData); }
|
||||
|
||||
TIDData mData;
|
||||
};
|
||||
|
||||
} // namespace object
|
||||
|
||||
@@ -28,7 +28,7 @@ struct TCreateObject : public JStudio::TCreateObject {
|
||||
};
|
||||
|
||||
struct TAdaptor_object_ {
|
||||
TAdaptor_object_(JStage::TSystem const*param_2, JStage::TObject *param_3) :
|
||||
TAdaptor_object_(const JStudio::TAdaptor *, JStage::TSystem const*param_2, JStage::TObject *param_3) :
|
||||
pJSGSystem_(param_2), pJSGObject_(param_3) {}
|
||||
void adaptor_object_data_(void const*, u32, void const*, u32);
|
||||
JStage::TObject* adaptor_object_findJSGObject_(char const*);
|
||||
@@ -258,7 +258,7 @@ struct TAdaptor_light : public JStudio::TAdaptor_light, public TAdaptor_object_
|
||||
virtual void operator()(f32, JStudio::TAdaptor*) const;
|
||||
virtual ~TVVOutput_direction_() {}
|
||||
|
||||
void adaptor_setOutput_(TAdaptor* adaptor) {
|
||||
void adaptor_setOutput_(TAdaptor* adaptor) const {
|
||||
adaptor->adaptor_referVariableValue(field_0x4)->setOutput(this);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user