Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def MatchingFor(*versions):
Object(Matching, "sora/if/if_adv_task.cpp"),
Object(Matching, "sora/gr/collision/gr_collision_data.cpp"),
Object(Matching, "sora/gr/collision/gr_collision_handle.cpp"),
Object(NonMatching, "sora/gr/gr_path.cpp"),
Object(Matching, "sora/gr/gr_path.cpp"),
Object(NonMatching, "sora/ac/ac_cmd_interpreter.cpp"),
Object(Matching, "sora/ac/ac_anim_cmd_impl.cpp"),
Object(Matching, "sora/ac/ac_null.cpp"),
Expand Down
19 changes: 9 additions & 10 deletions include/st_final/gr_final.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,18 @@ const float EFF_FRAME_MAX2 = 6100.0f;
class grFinal : public grYakumono {
protected:
char unk1;
float unk_float;
u8 type;
u8 step;
u16 padding;
float unk4;
u8 m_type;
u8 m_step;
u16 m_padding;

public:
grFinal(const char* taskName) : grYakumono(taskName)
{
grFinal(const char* taskName) : grYakumono(taskName) {
unk1 = 0;
unk_float = EFF_SOMETHING;
type = 0;
step = 0;
setupMelee();
unk4 = EFF_SOMETHING;
m_type = 0;
m_step = 0;
setupMelee();
};
virtual void update(float deltaFrame);
virtual ~grFinal();
Expand Down
2 changes: 1 addition & 1 deletion src/mo_stage/st_config/st_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void stConfig::createObj() {
grConfig *ground = grConfig::create(1,"", "grConfigMainBg");
if (ground) {
addGround(ground);
ground->startup(this->m_fileData, 0, gfSceneRoot::Layer_Ground);
ground->startup(m_fileData, 0, gfSceneRoot::Layer_Ground);
createCollision(m_fileData, 2, 0);
initCameraParam();
nw4r::g3d::ResFile posData(m_fileData->getData(Data_Type_Model, 0x64, 0xFFFE));
Expand Down
26 changes: 9 additions & 17 deletions src/mo_stage/st_dxshrine/gr_dxshrine.cpp
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@

#include <gr/gr_yakumono.h>
#include <gr/gr_gimmick.h>
#include <st_dxshrine/gr_dxshrine.h>

inline grDxShrine::grDxShrine(const char* taskName): grYakumono(taskName) {
setupMelee();
setupMelee();
}


grDxShrine* grDxShrine::create(int mdlIndex, const char *tgtNodeName, const char *taskName) {//: grPictchat(taskname) {
grDxShrine *bg = new (Heaps::StageInstance) grDxShrine(taskName);
if (bg != 0) {

//bg->setupMelee();
bg->setMdlIndex(mdlIndex);
//bg->m_heapType = Heaps::StageInstance;
//bg->makeCalcuCallback(1, Heaps::StageInstance);
//bg->setCalcuCallbackRoot(7);
bg->setTgtNode(tgtNodeName);
}
return bg;
grDxShrine* grDxShrine::create(int mdlIndex, const char *tgtNodeName, const char *taskName) {
grDxShrine *bg = new (Heaps::StageInstance) grDxShrine(taskName);
if (bg != 0) {
bg->setMdlIndex(mdlIndex);
bg->setTgtNode(tgtNodeName);
}
return bg;
}


grDxShrine::~grDxShrine() { }
grDxShrine::~grDxShrine() { }
9 changes: 4 additions & 5 deletions src/mo_stage/st_dxshrine/st_dxshrine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ void stDxShrine::createObj() {
grDxShrine *ground = grDxShrine::create(0,"", "grDxShrineMainBg");
if (ground) {
addGround(ground);
ground->startup(this->m_fileData, 0, gfSceneRoot::Layer_Ground);
ground->setStageData(&this->m_shrineStageData);
ground->startup(m_fileData, 0, gfSceneRoot::Layer_Ground);
ground->setStageData(&m_shrineStageData);
}
createCollision(m_fileData, 2, 0);
testStageParamInit(m_fileData, 0xA);
Expand All @@ -56,9 +56,8 @@ void stDxShrine::createObj() {
createObjPokeTrainer(m_fileData, 0x65, "PokeTrainer00", m_pokeTrainerPos, 0);
}

void stDxShrine::update(float deltaFrame) {
}
void stDxShrine::update(float deltaFrame) { }

void stDxShrine::initStageData() {
memset(&this->m_shrineStageData,0,1);
memset(&m_shrineStageData,0,1);
}
63 changes: 24 additions & 39 deletions src/mo_stage/st_final/gr_final.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,71 +2,56 @@
#include <ec/ec_mgr.h>
#include <memory.h>

grFinal* grFinal::create(int mdlIndex, const char* tgtNodeName, const char* taskName)
{
grFinal* grFinal::create(int mdlIndex, const char* tgtNodeName, const char* taskName) {
grFinal* ground = new (Heaps::StageInstance) grFinal(taskName);
if (ground) {
// ground->setupMelee();
ground->setMdlIndex(mdlIndex);
ground->setTgtNode(tgtNodeName);
}

if (ground) {
ground->setMdlIndex(mdlIndex);
ground->setTgtNode(tgtNodeName);
}
return ground;
}

grFinal::~grFinal() {

}
grFinal::~grFinal() { }

void grFinal::update(float deltaFrame)
{
this->updateEff();
void grFinal::update(float deltaFrame) {
updateEff();
}

void grFinal::updateEff()
{
if (this->type == 0)
{
switch (this->step)
{
void grFinal::updateEff() {
if (m_type == 0) {
switch (m_step) {
case 0:
g_ecMgr->setDrawPrio(1);
g_ecMgr->setEffect(ef_ptc_stg_final_zenpan);
g_ecMgr->setDrawPrio(0xffffffff);
unk_float = EFF_SOMETHING;
step++;
unk4 = EFF_SOMETHING;
m_step++;
break;
case 1:
if (!(this->getMotionFrame(0) < 2540.0f))
{
if (!(getMotionFrame(0) < 2540.0f)) {
g_ecMgr->setDrawPrio(1);
u32 unk = g_ecMgr->setEffect(ef_ptc_stg_final_star);
g_ecMgr->setDrawPrio(0xffffffff);
g_ecMgr->setParent(unk, this->m_sceneModels[0], "spaceB", 0); // sceneModel is actually supposed to be a wrapper of some kind
step++;
g_ecMgr->setParent(unk, m_sceneModels[0], "spaceB", 0); // sceneModel is actually supposed to be a wrapper of some kind
m_step++;
}
break;
case 2:
if (!(this->getMotionFrame(0) < 6100.0f))
// if (this->getMotionFrame(0) > 6100.0f)
{
if (!(getMotionFrame(0) < 6100.0f)) {
g_ecMgr->setDrawPrio(1);
u32 unk = g_ecMgr->setEffect(ef_ptc_stg_final_kirakira);
g_ecMgr->setDrawPrio(0xffffffff);
g_ecMgr->setParent(unk, this->m_sceneModels[0], "spaceF", 0); // sceneModel is actually supposed to be a wrapper of some kind
step++;
g_ecMgr->setParent(unk, m_sceneModels[0], "spaceF", 0); // sceneModel is actually supposed to be a wrapper of some kind
m_step++;
}
break;
case 3:
if (this->getMotionFrame(0) < this->unk_float)
{
step = 0;
}
else
{
this->unk_float = this->getMotionFrame(0);
if (getMotionFrame(0) < unk4) {
m_step = 0;
} else {
unk4 = getMotionFrame(0);
}
break;
}
}
}
}
4 changes: 2 additions & 2 deletions src/mo_stage/st_final/st_final.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ void stFinal::createObj()
nw4r::g3d::ResFileData* scnData = static_cast<nw4r::g3d::ResFileData*>(m_fileData->getData(Data_Type_Scene, 0, 0xfffe));
registScnAnim(scnData, 0);
initPosPokeTrainer(1, 0);
createObjPokeTrainer(m_fileData, 0x65, "PokeTrainer00", this->m_pokeTrainerPos, 0x0);
createObjPokeTrainer(m_fileData, 0x65, "PokeTrainer00", m_pokeTrainerPos, 0x0);
}

void grFinal::setType(int type) {
this->type = type;
m_type = type;
}

void stFinal::update(float deltaFrame) { }
9 changes: 5 additions & 4 deletions src/sora/gr/gr_path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@

typedef grFixedPath::UnkClass UnkClass;

// NONMATCHING regswap
void grFixedPathCollection::relocation() {
m_paths = m_pathData;
UnkClass* data;
u32 offset = 0;
u32 count = m_count;
UnkClass* data = reinterpret_cast<UnkClass*>(m_paths + m_count);
const u32 count = m_count;

m_paths = m_pathData;
data = reinterpret_cast<UnkClass*>(m_paths + m_count);
for (u32 i = 0; i != count; i++) {
grFixedPath* p = &m_paths[i];
p->m_data = data + offset;
Expand Down
Loading