mirror of
https://github.com/zeldaret/tp
synced 2026-07-10 07:06:50 -04:00
JStudio debug improvements (#2902)
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user