-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
d_t_time_area_check OK (and some dTimeAreaMgr) (#29)
- Loading branch information
1 parent
24e10d2
commit 6336533
Showing
11 changed files
with
209 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
_prolog = .text:0x00000000; // type:function size:0x2C scope:global | ||
_epilog = .text:0x00000030; // type:function size:0x2C scope:global | ||
_unresolved = .text:0x00000060; // type:function size:0x4 scope:global | ||
fn_597_70 = .text:0x00000070; // type:function size:0x4C | ||
fn_597_C0 = .text:0x000000C0; // type:function size:0x18 | ||
fn_597_E0 = .text:0x000000E0; // type:function size:0x8 | ||
fn_597_F0 = .text:0x000000F0; // type:function size:0x1AC | ||
fn_597_2A0 = .text:0x000002A0; // type:function size:0x8 | ||
fn_597_2B0 = .text:0x000002B0; // type:function size:0x5C | ||
dTgTimeAreaCheck_c_classInit__Fv = .text:0x00000070; // type:function size:0x4C | ||
create__18dTgTimeAreaCheck_cFv = .text:0x000000C0; // type:function size:0x18 | ||
doDelete__18dTgTimeAreaCheck_cFv = .text:0x000000E0; // type:function size:0x8 | ||
actorExecute__18dTgTimeAreaCheck_cFv = .text:0x000000F0; // type:function size:0x1AC | ||
draw__18dTgTimeAreaCheck_cFv = .text:0x000002A0; // type:function size:0x8 | ||
__dt__18dTgTimeAreaCheck_cFv = .text:0x000002B0; // type:function size:0x5C | ||
_ctors = .ctors:0x00000000; // type:label scope:global | ||
_dtors = .dtors:0x00000000; // type:label scope:global | ||
lbl_597_rodata_0 = .rodata:0x00000000; // type:object size:0x4 data:float | ||
lbl_597_rodata_4 = .rodata:0x00000004; // type:object size:0x4 data:float | ||
lbl_597_data_0 = .data:0x00000000; // type:object size:0x10 | ||
lbl_597_data_10 = .data:0x00000010; // type:object size:0x74 | ||
lbl_597_rodata_0 = .rodata:0x00000000; // type:object size:0x4 scope:local data:float | ||
lbl_597_rodata_4 = .rodata:0x00000004; // type:object size:0x4 scope:local data:float | ||
g_profile_TAG_TIME_AREA_CHECK = .data:0x00000000; // type:object size:0x10 | ||
__vt__18dTgTimeAreaCheck_c = .data:0x00000010; // type:object size:0x74 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#ifndef D_T_TIME_AREA_CHECK_H | ||
#define D_T_TIME_AREA_CHECK_H | ||
|
||
#include <d/tg/d_tg.h> | ||
|
||
class dTgTimeAreaCheck_c : public dTg_c { | ||
public: | ||
dTgTimeAreaCheck_c() {} | ||
virtual ~dTgTimeAreaCheck_c() {} | ||
|
||
virtual int create() override; | ||
virtual int doDelete() override; | ||
virtual int actorExecute() override; | ||
virtual int draw() override; | ||
|
||
private: | ||
u8 mPastSceneFlag; | ||
u8 mPresentSceneFlag; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#ifndef D_TIME_AREA_MGR_H | ||
#define D_TIME_AREA_MGR_H | ||
|
||
#include <m/m3d/m_proc.h> | ||
#include <m/m_allocator.h> | ||
#include <m/m_vec.h> | ||
|
||
|
||
class dTimeAreaMgrProcA_c : public m3d::proc_c { | ||
public: | ||
dTimeAreaMgrProcA_c() {} | ||
|
||
bool create(mHeapAllocator_c *alloc); | ||
|
||
void drawOpa() override; | ||
}; | ||
|
||
class dTimeAreaMgrProcB_c : public m3d::proc_c { | ||
public: | ||
dTimeAreaMgrProcB_c() {} | ||
|
||
bool create(mHeapAllocator_c *alloc); | ||
|
||
void drawOpa() override; | ||
|
||
private: | ||
/* 0x18 */ u8 field_0x18; | ||
/* 0x19 */ u8 field_0x19; | ||
/* 0x1A */ u8 field_0x1A; | ||
/* 0x1B */ u8 field_0x1B; | ||
}; | ||
|
||
class dTimeAreaMgr_c { | ||
public: | ||
dTimeAreaMgr_c(); | ||
virtual ~dTimeAreaMgr_c(); | ||
|
||
bool init(); | ||
void draw(); | ||
|
||
f32 checkPositionIsInPastState(s32 roomId, const mVec3_c &position, float *, float); | ||
|
||
static dTimeAreaMgr_c *sInstance; | ||
|
||
private: | ||
/* 0x04 */ u8 field_0x04[0x0C - 0x04]; | ||
/* 0x0C */ mHeapAllocator_c mAllocator; | ||
/* 0x28 */ dTimeAreaMgrProcA_c mProcA; | ||
/* 0x40 */ dTimeAreaMgrProcB_c mProcB; | ||
/* 0x5C */ u8 field_0x5C[0x64 - 0x5C]; | ||
/* 0x64 */ s32 field_0x64; | ||
/* 0x68 */ u8 field_0x68[0x7B - 0x68]; | ||
/* 0x7B */ bool mIsInLanayruMiningFacility; | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include <d/tg/d_t_time_area_check.h> | ||
#include <toBeSorted/time_area_mgr.h> | ||
#include <toBeSorted/sceneflag_manager.h> | ||
|
||
SPECIAL_ACTOR_PROFILE(TAG_TIME_AREA_CHECK, dTgTimeAreaCheck_c, fProfile::TAG_TIME_AREA_CHECK, 0x01AC, 0, 0); | ||
|
||
int dTgTimeAreaCheck_c::create() { | ||
mPastSceneFlag = params & 0xFF; | ||
mPresentSceneFlag = (params >> 8) & 0xFF; | ||
return SUCCEEDED; | ||
} | ||
|
||
int dTgTimeAreaCheck_c::doDelete() { | ||
return 1; | ||
} | ||
|
||
int dTgTimeAreaCheck_c::actorExecute() { | ||
f32 result = dTimeAreaMgr_c::sInstance->checkPositionIsInPastState(roomid, position, nullptr, 10.0f); | ||
if (result > 0.0f) { | ||
if (mPastSceneFlag < 0xFF && !SceneflagManager::sInstance->checkBoolFlag(roomid, mPastSceneFlag)) { | ||
SceneflagManager::sInstance->setFlag(roomid, mPastSceneFlag); | ||
} | ||
if (mPresentSceneFlag < 0xFF && SceneflagManager::sInstance->checkBoolFlag(roomid, mPresentSceneFlag)) { | ||
SceneflagManager::sInstance->unsetFlag(roomid, mPresentSceneFlag); | ||
} | ||
} else { | ||
if (mPastSceneFlag < 0xFF && SceneflagManager::sInstance->checkBoolFlag(roomid, mPastSceneFlag)) { | ||
SceneflagManager::sInstance->unsetFlag(roomid, mPastSceneFlag); | ||
} | ||
if (mPresentSceneFlag < 0xFF && !SceneflagManager::sInstance->checkBoolFlag(roomid, mPresentSceneFlag)) { | ||
SceneflagManager::sInstance->setFlag(roomid, mPresentSceneFlag); | ||
} | ||
} | ||
return 1; | ||
} | ||
|
||
int dTgTimeAreaCheck_c::draw() { | ||
return 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#include <toBeSorted/time_area_mgr.h> | ||
#include <toBeSorted/scgame.h> | ||
#include <nw4r/g3d/g3d_obj.h> | ||
#include <d/d_heap.h> | ||
|
||
|
||
dTimeAreaMgr_c::dTimeAreaMgr_c() { | ||
sInstance = this; | ||
} | ||
|
||
dTimeAreaMgr_c::~dTimeAreaMgr_c() { | ||
sInstance = nullptr; | ||
} | ||
|
||
bool dTimeAreaMgr_c::init() { | ||
mAllocator.replaceWithNewFrmHeap(-1, dHeap::work1Heap.heap, "dTimeAreaMgr_c::m_allocator", 0x20, 0); | ||
mProcA.create(&mAllocator); | ||
mProcB.create(&mAllocator); | ||
mAllocator.adjustFrmHeap(); | ||
mIsInLanayruMiningFacility = ScGame::isCurrentStage("D300") || ScGame::isCurrentStage("D300_1"); | ||
return true; | ||
} | ||
|
||
void dTimeAreaMgr_c::draw() { | ||
if (field_0x64 != 0 && dTimeAreaMgr_c::sInstance->field_0x68[0x10] == 0) { | ||
mProcA.entry(); | ||
mProcB.entry(); | ||
} | ||
} | ||
|
||
void dTimeAreaMgrProcA_c::drawOpa() { | ||
// TODO | ||
} | ||
|
||
bool dTimeAreaMgrProcA_c::create(mHeapAllocator_c *alloc) { | ||
if (!m3d::proc_c::create(alloc, nullptr)) { | ||
return false; | ||
} | ||
|
||
setPriorityDraw(0x0C, 0); | ||
setOption(/* DISABLE_DRAW_XLU */ 0x07, 1); | ||
return true; | ||
} | ||
|
||
void dTimeAreaMgrProcB_c::drawOpa() { | ||
// TODO | ||
} | ||
|
||
bool dTimeAreaMgrProcB_c::create(mHeapAllocator_c *alloc) { | ||
if (!m3d::proc_c::create(alloc, nullptr)) { | ||
return false; | ||
} | ||
|
||
setPriorityDraw(0x13, 0); | ||
setOption(/* DISABLE_DRAW_XLU */ 0x07, 1); | ||
field_0x18 = 0x8C; | ||
field_0x19 = 0x64; | ||
field_0x1A = 0x3C; | ||
field_0x1B = 0x64; | ||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters