mirror of https://github.com/zeldaret/tp.git
JStudio debug improvements (#2902)
This commit is contained in:
parent
1e2d9151a0
commit
6a5397e847
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/JStage/JSGCamera.h"
|
||||
#include "math.h"
|
||||
#include "limits.h"
|
||||
|
||||
JStage::TCamera::~TCamera() {}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#include "JSystem/JSystem.h" // IWYU pragma: keep
|
||||
|
||||
#include "JSystem/JStage/JSGFog.h"
|
||||
#include "math.h"
|
||||
#include "limits.h"
|
||||
|
||||
JStage::TFog::~TFog() {}
|
||||
|
||||
|
|
@ -22,7 +22,7 @@ f32 JStage::TFog::JSGGetStartZ() const {
|
|||
void JStage::TFog::JSGSetStartZ(f32) {}
|
||||
|
||||
f32 JStage::TFog::JSGGetEndZ() const {
|
||||
return FLT_MAX;
|
||||
return std::numeric_limits<f32>::max();
|
||||
}
|
||||
|
||||
void JStage::TFog::JSGSetEndZ(f32) {}
|
||||
|
|
|
|||
|
|
@ -16,31 +16,37 @@ int JStudio::ctb::TObject_TxyzRy::getScheme() const {
|
|||
|
||||
JStudio::ctb::TControl::TControl() : pFactory_(NULL) {}
|
||||
|
||||
JStudio::ctb::TControl::~TControl() {}
|
||||
|
||||
void JStudio::ctb::TControl::appendObject(JStudio::ctb::TObject* param_0) {
|
||||
mList.Push_back(param_0);
|
||||
JStudio::ctb::TControl::~TControl() {
|
||||
JGADGET_ASSERTWARN(94, ocObject_.empty());
|
||||
}
|
||||
|
||||
void JStudio::ctb::TControl::removeObject(JStudio::ctb::TObject* param_0) {
|
||||
mList.Erase(param_0);
|
||||
void JStudio::ctb::TControl::appendObject(JStudio::ctb::TObject* p) {
|
||||
JUT_ASSERT(106, p!=NULL)
|
||||
ocObject_.Push_back(p);
|
||||
}
|
||||
|
||||
void JStudio::ctb::TControl::removeObject(JStudio::ctb::TObject* p) {
|
||||
JUT_ASSERT(113, p!=NULL)
|
||||
ocObject_.Erase(p);
|
||||
}
|
||||
|
||||
void JStudio::ctb::TControl::destroyObject(JStudio::ctb::TObject* param_0) {
|
||||
removeObject(param_0);
|
||||
getFactory()->destroy(param_0);
|
||||
TFactory *pFactory = getFactory();
|
||||
JUT_ASSERT(129, pFactory!=NULL);
|
||||
pFactory->destroy(param_0);
|
||||
}
|
||||
|
||||
void JStudio::ctb::TControl::destroyObject_all() {
|
||||
while (!mList.empty()) {
|
||||
destroyObject(&mList.back());
|
||||
while (!ocObject_.empty()) {
|
||||
destroyObject(&ocObject_.back());
|
||||
}
|
||||
}
|
||||
|
||||
// NONMATCHING - TPRObject_ID_equal issues
|
||||
JStudio::ctb::TObject* JStudio::ctb::TControl::getObject(void const* param_0, u32 param_1) {
|
||||
JGadget::TLinkList<TObject, -12>::iterator begin = mList.begin();
|
||||
JGadget::TLinkList<TObject, -12>::iterator end = mList.end();
|
||||
JGadget::TLinkList<TObject, -12>::iterator begin = ocObject_.begin();
|
||||
JGadget::TLinkList<TObject, -12>::iterator end = ocObject_.end();
|
||||
JGadget::TLinkList<TObject, -12>::iterator local_50 = std::find_if(begin, end, object::TPRObject_ID_equal(param_0, param_1));
|
||||
if ((local_50 != end) != false) {
|
||||
return &*local_50;
|
||||
|
|
@ -49,10 +55,10 @@ JStudio::ctb::TObject* JStudio::ctb::TControl::getObject(void const* param_0, u3
|
|||
}
|
||||
|
||||
JStudio::ctb::TObject* JStudio::ctb::TControl::getObject_index(u32 param_0) {
|
||||
if (param_0 >= mList.size()) {
|
||||
if (param_0 >= ocObject_.size()) {
|
||||
return 0;
|
||||
}
|
||||
JGadget::TLinkList<TObject, -12>::iterator aiStack_14 = mList.begin();
|
||||
JGadget::TLinkList<TObject, -12>::iterator aiStack_14 = ocObject_.begin();
|
||||
std::advance_fake(aiStack_14, param_0);
|
||||
return &*aiStack_14;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ void TFunctionValueAttribute_range::range_set(f64 begin, f64 end) {
|
|||
fEnd_ = end;
|
||||
fDifference_ = end - begin;
|
||||
|
||||
JUT_ASSERT(458, fDifference_ >= TValue(0));
|
||||
JUT_ASSERT(458, fDifference_>=TValue(0));
|
||||
}
|
||||
|
||||
// /* 80281A08-80281D18 27C348 0310+00 2/2 0/0 0/0 .text
|
||||
|
|
|
|||
|
|
@ -2,15 +2,17 @@
|
|||
|
||||
#include "JSystem/JStudio/JStudio/fvb-data-parse.h"
|
||||
|
||||
void JStudio::fvb::data::TParse_TParagraph::getData(TParse_TParagraph::TData* data) const
|
||||
void JStudio::fvb::data::TParse_TParagraph::getData(TParse_TParagraph::TData* pData) const
|
||||
{
|
||||
u16* parse = (u16*)JGadget::binary::parseVariableUInt_16_32_following(getRaw(), (u32*)data, (u32*)&data->u32Type, NULL);
|
||||
u32 t = (u32)data->u32Size;
|
||||
JUT_ASSERT(24, pData!=NULL);
|
||||
const void *ptr = getRaw();
|
||||
ptr = JGadget::binary::parseVariableUInt_16_32_following(ptr, (u32*)pData, (u32*)&pData->u32Type, NULL);
|
||||
u32 t = (u32)pData->u32Size;
|
||||
if (!t) {
|
||||
data->pContent = NULL;
|
||||
data->next = parse;
|
||||
pData->pContent = NULL;
|
||||
pData->next = (const u16*)ptr;
|
||||
} else {
|
||||
data->pContent = parse;
|
||||
data->next = parse + ((t + 3) >> 1 & ~1);
|
||||
pData->pContent = (const u16*)ptr;
|
||||
pData->next = (u8*)ptr + JGadget::binary::align_roundUp(t, 4);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,12 +73,16 @@ void JStudio::TVariableValue::update_immediate_(JStudio::TVariableValue* param_0
|
|||
}
|
||||
|
||||
void JStudio::TVariableValue::update_time_(JStudio::TVariableValue* param_0, f64 param_1) {
|
||||
param_0->mValue = param_0->field_0xc.val * (param_0->field_0x4 * param_1);
|
||||
f64 v = param_0->field_0xc.val * (param_0->field_0x4 * param_1);
|
||||
param_0->mValue = v;
|
||||
}
|
||||
|
||||
void JStudio::TVariableValue::update_functionValue_(JStudio::TVariableValue* param_0,
|
||||
f64 param_1) {
|
||||
param_0->mValue = param_0->field_0xc.fv->getValue(param_0->field_0x4 * param_1);
|
||||
|
||||
TFunctionValue *fv = param_0->field_0xc.fv;
|
||||
f64 v = fv->getValue(param_0->field_0x4 * param_1);
|
||||
param_0->mValue = v;
|
||||
}
|
||||
|
||||
JStudio::TVariableValue::TOutput_none_::~TOutput_none_() {}
|
||||
|
|
|
|||
|
|
@ -9,39 +9,41 @@ namespace stb {
|
|||
namespace data {
|
||||
|
||||
void TParse_TSequence::getData(TData* pData) const {
|
||||
ASSERT(pData != NULL);
|
||||
JUT_ASSERT(50, pData!=NULL);
|
||||
|
||||
pData->content = NULL;
|
||||
pData->next = NULL;
|
||||
u32 head = get_head();
|
||||
u8 type = head >> 24;
|
||||
u32 param = head & 0xffffff;
|
||||
pData->type = type;
|
||||
pData->type = type & 0xff;
|
||||
pData->param = param;
|
||||
if (type != 0) {
|
||||
const void* next = (const void*)((int)getRaw() + 4);
|
||||
if (type <= 0x7f) {
|
||||
pData->next = next;
|
||||
} else {
|
||||
pData->content = next;
|
||||
pData->next = (const void*)((int)next + param);
|
||||
}
|
||||
|
||||
if (type == 0)
|
||||
return;
|
||||
|
||||
const void* next = (const void*)((int)getRaw() + 4);
|
||||
if (type <= 0x7f) {
|
||||
pData->next = next;
|
||||
} else {
|
||||
pData->content = next;
|
||||
pData->next = (const void*)((int)next + param);
|
||||
}
|
||||
}
|
||||
|
||||
void TParse_TParagraph::getData(TData* pData) const {
|
||||
ASSERT(pData != NULL);
|
||||
JUT_ASSERT(80, pData!=NULL);
|
||||
|
||||
const void* data = getRaw();
|
||||
u32 result;
|
||||
const void* next = parseVariableUInt_16_32_following(data, &result, &pData->type, NULL);
|
||||
data = parseVariableUInt_16_32_following(data, &result, &pData->type, NULL);
|
||||
pData->param = result;
|
||||
if (result == 0) {
|
||||
pData->content = NULL;
|
||||
pData->next = next;
|
||||
pData->next = data;
|
||||
} else {
|
||||
pData->content = next;
|
||||
pData->next = (const void*)((int)next + align_roundUp(result, 4));
|
||||
pData->content = data;
|
||||
pData->next = (const void*)((int)data + align_roundUp(result, 4));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -109,11 +109,11 @@ void JStudio_JAudio2::TAdaptor_sound::adaptor_do_update(u32 param_1) {
|
|||
JUT_ASSERT(196, pControl!=NULL);
|
||||
JStudio::TControl::TTransform_position VStack_148;
|
||||
JStudio::TControl::TTransform_position VStack_154;
|
||||
JStudio::TControl::TTransform_position* pVVar2;
|
||||
const JStudio::TControl::TTransform_position* pVVar2;
|
||||
adaptor_getVariableValue_Vec(&VStack_148,
|
||||
JStudio::TAdaptor_sound::sauVariableValue_3_POSITION_XYZ);
|
||||
if (field_0x144 == 0) {
|
||||
pVVar2 = pControl->transformOnSet_transform_ifEnabled(&VStack_148, &VStack_154);
|
||||
pVVar2 = pControl->transformOnSet_transform_ifEnabled(VStack_148, &VStack_154);
|
||||
} else {
|
||||
if (!JStudio_JStage::transform_toGlobalFromLocal(&VStack_154, VStack_148, field_0x13c, field_0x140)) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -281,10 +281,10 @@ JStudio_JParticle::TAdaptor_particle::TJPACallback_emitter_::execute(JPABaseEmit
|
|||
&VStack_19c.scaling,
|
||||
sauVariableValue_3_SCALING_XYZ);
|
||||
if (pThis_->field_0x1d8 == 0) {
|
||||
JStudio::TControl::TTransform_translation_rotation_scaling* pVVar9 = &VStack_19c;
|
||||
const JStudio::TControl::TTransform_translation_rotation_scaling* pVVar9 = &VStack_19c;
|
||||
switch(pThis_->field_0x1cc) {
|
||||
case 0:
|
||||
pVVar9 = pControl->transformOnSet_transform_ifEnabled(&VStack_19c, &aTStack_1c0);
|
||||
pVVar9 = pControl->transformOnSet_transform_ifEnabled(VStack_19c, &aTStack_1c0);
|
||||
break;
|
||||
case 1:
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
JStudio_JStage::TAdaptor_actor::TAdaptor_actor(JStage::TSystem const* param_1,
|
||||
JStage::TActor* param_2) :
|
||||
TAdaptor_object_(param_1,param_2) {
|
||||
TAdaptor_object_(this, param_1,param_2) {
|
||||
field_0x130 = 0;
|
||||
field_0x134 = 0;
|
||||
field_0x138 = 0;
|
||||
|
|
@ -265,9 +265,9 @@ void JStudio_JStage::TAdaptor_actor::setJSG_SRT_(JStudio::TControl const* pContr
|
|||
adaptor_getVariableValue_Vec(&transform.translation, sauVariableValue_3_TRANSLATION_XYZ);
|
||||
adaptor_getVariableValue_Vec(&transform.rotation, sauVariableValue_3_ROTATION_XYZ);
|
||||
adaptor_getVariableValue_Vec(&transform.scaling, sauVariableValue_3_SCALING_XYZ);
|
||||
JStudio::TControl::TTransform_translation_rotation_scaling* pTransform;
|
||||
const JStudio::TControl::TTransform_translation_rotation_scaling* pTransform;
|
||||
if (field_0x144 == 0) {
|
||||
pTransform = pControl->transformOnSet_transform_ifEnabled(&transform, &multipliedTransform);
|
||||
pTransform = pControl->transformOnSet_transform_ifEnabled(transform, &multipliedTransform);
|
||||
} else {
|
||||
pTransform = &transform;
|
||||
switch (field_0x138) {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
JStudio_JStage::TAdaptor_ambientLight::TAdaptor_ambientLight(JStage::TSystem const* param_1,
|
||||
JStage::TAmbientLight* param_2)
|
||||
: TAdaptor_object_(param_1, param_2) {}
|
||||
: TAdaptor_object_(this, param_1, param_2) {}
|
||||
|
||||
JStudio_JStage::TAdaptor_ambientLight::~TAdaptor_ambientLight() {
|
||||
adaptor_do_end();
|
||||
|
|
@ -19,7 +19,8 @@ void JStudio_JStage::TAdaptor_ambientLight::adaptor_do_prepare() {
|
|||
|
||||
void JStudio_JStage::TAdaptor_ambientLight::adaptor_do_begin() {
|
||||
adaptor_object_begin_();
|
||||
GXColor color = get_pJSG_()->JSGGetColor();
|
||||
JStage::TAmbientLight* light = get_pJSG_();
|
||||
GXColor color = light->JSGGetColor();
|
||||
adaptor_setVariableValue_GXColor(sauVariableValue_4_COLOR_RGBA, color);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
JStudio_JStage::TAdaptor_camera::TAdaptor_camera(JStage::TSystem const* param_1,
|
||||
JStage::TCamera* param_2)
|
||||
: TAdaptor_object_(param_1, param_2) {
|
||||
: TAdaptor_object_(this, param_1, param_2) {
|
||||
field_0x108 = 0;
|
||||
field_0x10c = 0;
|
||||
field_0x110 = -1;
|
||||
|
|
@ -201,9 +201,9 @@ void JStudio_JStage::TAdaptor_camera::setJSG_position_(JStudio::TControl const*
|
|||
JStudio::TControl::TTransform_position VStack_138;
|
||||
JStudio::TControl::TTransform_position VStack_144;
|
||||
adaptor_getVariableValue_Vec(&VStack_138, sauVariableValue_3_POSITION_XYZ);
|
||||
Vec* pViewPosition;
|
||||
const Vec* pViewPosition;
|
||||
if (field_0x114 == 0) {
|
||||
pViewPosition = param_1->transformOnSet_transform_ifEnabled(&VStack_138, &VStack_144);
|
||||
pViewPosition = param_1->transformOnSet_transform_ifEnabled(VStack_138, &VStack_144);
|
||||
} else {
|
||||
pViewPosition = &VStack_138;
|
||||
switch (field_0x108) {
|
||||
|
|
@ -226,12 +226,12 @@ void JStudio_JStage::TAdaptor_camera::getJSG_position_(JStudio::TControl const*
|
|||
Mtx mtx;
|
||||
JStudio::TControl::TTransform_position transform;
|
||||
JStudio::TControl::TTransform_position tempTransform;
|
||||
JStudio::TControl::TTransform_position* outTransform;
|
||||
const JStudio::TControl::TTransform_position* outTransform;
|
||||
|
||||
get_pJSG_()->JSGGetViewPosition(&transform);
|
||||
|
||||
if (!field_0x114) {
|
||||
outTransform = param_1->transformOnGet_transform_ifEnabled(&transform, &tempTransform);
|
||||
outTransform = param_1->transformOnGet_transform_ifEnabled(transform, &tempTransform);
|
||||
} else {
|
||||
outTransform = &transform;
|
||||
switch (field_0x108) {
|
||||
|
|
@ -262,11 +262,11 @@ void JStudio_JStage::TAdaptor_camera::getJSG_position_(JStudio::TControl const*
|
|||
void JStudio_JStage::TAdaptor_camera::setJSG_targetPosition_(JStudio::TControl const* param_1) {
|
||||
JStudio::TControl::TTransform_position transform;
|
||||
JStudio::TControl::TTransform_position tempTransform;
|
||||
JStudio::TControl::TTransform_position* outTransform;
|
||||
const JStudio::TControl::TTransform_position* outTransform;
|
||||
adaptor_getVariableValue_Vec(&transform, sauVariableValue_3_TARGET_POSITION_XYZ);
|
||||
if (field_0x120 == 0) {
|
||||
outTransform = param_1->transformOnSet_transform_ifEnabled(
|
||||
&transform, &tempTransform);
|
||||
transform, &tempTransform);
|
||||
} else {
|
||||
if (transform_toGlobalFromLocal(&tempTransform, transform,
|
||||
field_0x118, field_0x11c) == 0) {
|
||||
|
|
@ -281,12 +281,12 @@ void JStudio_JStage::TAdaptor_camera::getJSG_targetPosition_(JStudio::TControl c
|
|||
Mtx mtx;
|
||||
JStudio::TControl::TTransform_position transform;
|
||||
JStudio::TControl::TTransform_position tempTransform;
|
||||
JStudio::TControl::TTransform_position* outTransform;
|
||||
const JStudio::TControl::TTransform_position* outTransform;
|
||||
|
||||
get_pJSG_()->JSGGetViewTargetPosition(&transform);
|
||||
|
||||
if (!field_0x120) {
|
||||
outTransform = param_1->transformOnGet_transform_ifEnabled(&transform, &tempTransform);
|
||||
outTransform = param_1->transformOnGet_transform_ifEnabled(transform, &tempTransform);
|
||||
} else {
|
||||
outTransform = &transform;
|
||||
bool check;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#include "JSystem/JStudio/JStudio_JStage/object-fog.h"
|
||||
|
||||
JStudio_JStage::TAdaptor_fog::TAdaptor_fog(JStage::TSystem const* param_0, JStage::TFog* param_1)
|
||||
: TAdaptor_object_(param_0, param_1) {}
|
||||
: TAdaptor_object_(this, param_0, param_1) {}
|
||||
|
||||
JStudio_JStage::TAdaptor_fog::~TAdaptor_fog() {
|
||||
adaptor_do_end();
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
JStudio_JStage::TAdaptor_light::TAdaptor_light(JStage::TSystem const* param_1,
|
||||
JStage::TLight* param_2)
|
||||
: JStudio_JStage::TAdaptor_object_(param_1, param_2) {
|
||||
: JStudio_JStage::TAdaptor_object_(this, param_1, param_2) {
|
||||
field_0x11c = 0;
|
||||
}
|
||||
|
||||
|
|
@ -55,7 +55,7 @@ void JStudio_JStage::TAdaptor_light::adaptor_do_begin() {
|
|||
JStudio::TControl::TTransform_position_direction aTStack_b8;
|
||||
pLightObj->JSGGetPosition(&lightObjTransform.position);
|
||||
pLightObj->JSGGetDirection(&lightObjTransform.direction);
|
||||
JStudio::TControl::TTransform_position_direction* finalTransform =
|
||||
const JStudio::TControl::TTransform_position_direction* finalTransform =
|
||||
pControl->transformOnGet_transform_ifEnabled(lightObjTransform, &aTStack_b8);
|
||||
adaptor_setVariableValue_Vec(sauVariableValue_3_POSITION_XYZ, finalTransform->position);
|
||||
f32 dirx = finalTransform->direction.x;
|
||||
|
|
@ -106,8 +106,8 @@ void JStudio_JStage::TAdaptor_light::adaptor_do_update(u32 param_1) {
|
|||
adaptor_getVariableValue_Vec(&VStack_1c0, sauVariableValue_3_TARGET_POSITION_XYZ);
|
||||
VECSubtract(&VStack_1c0, &VStack_198.position, &VStack_198.direction);
|
||||
}
|
||||
JStudio::TControl::TTransform_position_direction* pTrans =
|
||||
pControl->transformOnSet_transform_ifEnabled(&VStack_198, &aTStack_1b0);
|
||||
const JStudio::TControl::TTransform_position_direction* pTrans =
|
||||
pControl->transformOnSet_transform_ifEnabled(VStack_198, &aTStack_1b0);
|
||||
lightObj->JSGSetPosition(pTrans->position);
|
||||
lightObj->JSGSetDirection(pTrans->direction);
|
||||
pJSGObject_->JSGUpdate();
|
||||
|
|
@ -152,5 +152,7 @@ void JStudio_JStage::TAdaptor_light::adaptor_do_ENABLE(JStudio::data::TEOperatio
|
|||
|
||||
void JStudio_JStage::TAdaptor_light::TVVOutput_direction_::operator()(
|
||||
f32 param_0, JStudio::TAdaptor* param_1) const {
|
||||
((JStudio_JStage::TAdaptor_light*)param_1)->field_0x11c = field_0x8;
|
||||
JStudio_JStage::TAdaptor_light* p = (JStudio_JStage::TAdaptor_light*)param_1;
|
||||
JUT_ASSERT(246, p!=NULL);
|
||||
p->field_0x11c = field_0x8;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,6 +73,7 @@ ForwardIterator upper_bound(ForwardIterator first, ForwardIterator last, const T
|
|||
return first;
|
||||
}
|
||||
|
||||
// should be inline, but breaks JStudio/JStudio/ctb weak function order
|
||||
template<class InputIt, class UnaryPredicate>
|
||||
InputIt find_if(InputIt first, InputIt last, UnaryPredicate p) {
|
||||
while (first != last && !p(*first)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue