-
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.
- Loading branch information
1 parent
0f9ef3d
commit 40e01ec
Showing
8 changed files
with
133 additions
and
27 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,27 +1,27 @@ | ||
_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_301_70 = .text:0x00000070; // type:function size:0x4C | ||
fn_301_C0 = .text:0x000000C0; // type:function size:0x6C | ||
fn_301_130 = .text:0x00000130; // type:function size:0x14 | ||
fn_301_150 = .text:0x00000150; // type:function size:0x58 | ||
fn_301_1B0 = .text:0x000001B0; // type:function size:0x7C | ||
fn_301_230 = .text:0x00000230; // type:function size:0x50 | ||
fn_301_280 = .text:0x00000280; // type:function size:0x8 | ||
fn_301_290 = .text:0x00000290; // type:function size:0x8 | ||
fn_301_2A0 = .text:0x000002A0; // type:function size:0x128 | ||
fn_301_3D0 = .text:0x000003D0; // type:function size:0xCC | ||
fn_301_4A0 = .text:0x000004A0; // type:function size:0x6C | ||
fn_301_510 = .text:0x00000510; // type:function size:0x5C | ||
dTgFairy_c_classInit__Fv = .text:0x00000070; // type:function size:0x4C | ||
createHeap__10dTgFairy_cFv = .text:0x000000C0; // type:function size:0x6C | ||
__ct__25dAcRef_c<13dAcObjFairy_c>Fv = .text:0x00000130; // type:function size:0x14 | ||
__dt__25dAcRef_c<13dAcObjFairy_c>Fv = .text:0x00000150; // type:function size:0x58 | ||
create__10dTgFairy_cFv = .text:0x000001B0; // type:function size:0x7C | ||
doDelete__10dTgFairy_cFv = .text:0x00000230; // type:function size:0x50 | ||
actorExecute__10dTgFairy_cFv = .text:0x00000280; // type:function size:0x8 | ||
draw__10dTgFairy_cFv = .text:0x00000290; // type:function size:0x8 | ||
createFairies__10dTgFairy_cFv = .text:0x000002A0; // type:function size:0x128 | ||
calcLocation__10dTgFairy_cFRCf = .text:0x000003D0; // type:function size:0xCC | ||
calcRnd__10dTgFairy_cFRCfRCf = .text:0x000004A0; // type:function size:0x6C | ||
__dt__10dTgFairy_cFv = .text:0x00000510; // type:function size:0x5C | ||
_ctors = .ctors:0x00000000; // type:label scope:global | ||
_dtors = .dtors:0x00000000; // type:label scope:global | ||
lbl_301_rodata_0 = .rodata:0x00000000; // type:object size:0x4 data:float | ||
lbl_301_rodata_8 = .rodata:0x00000008; // type:object size:0x8 data:double | ||
lbl_301_rodata_10 = .rodata:0x00000010; // type:object size:0x4 data:float | ||
lbl_301_rodata_14 = .rodata:0x00000014; // type:object size:0x4 data:float | ||
lbl_301_data_0 = .data:0x00000000; // type:object size:0x10 | ||
lbl_301_data_10 = .data:0x00000010; // type:object size:0x18 data:string | ||
lbl_301_data_28 = .data:0x00000028; // type:object size:0x8 | ||
lbl_301_data_30 = .data:0x00000030; // type:object size:0x4 | ||
lbl_301_data_34 = .data:0x00000034; // type:object size:0x4 | ||
lbl_301_data_38 = .data:0x00000038; // type:object size:0x74 | ||
lbl_301_rodata_0 = .rodata:0x00000000; // type:object size:0x4 scope:local data:float | ||
lbl_301_rodata_8 = .rodata:0x00000008; // type:object size:0x8 scope:local data:double | ||
lbl_301_rodata_10 = .rodata:0x00000010; // type:object size:0x4 scope:local data:float | ||
lbl_301_rodata_14 = .rodata:0x00000014; // type:object size:0x4 scope:local data:float | ||
g_profile_T_FAIRY = .data:0x00000000; // type:object size:0x10 | ||
lbl_301_data_10 = .data:0x00000010; // type:object size:0x18 scope:local data:string | ||
lbl_301_data_28 = .data:0x00000028; // type:object size:0x8 scope:local | ||
lbl_301_data_30 = .data:0x00000030; // type:object size:0x4 scope:local | ||
lbl_301_data_34 = .data:0x00000034; // type:object size:0x4 scope:local | ||
__vt__10dTgFairy_c = .data:0x00000038; // 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
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,27 @@ | ||
#ifndef D_T_GENKI_DWS_TGT_H | ||
#define D_T_GENKI_DWS_TGT_H | ||
|
||
#include <d/a/obj/d_a_obj_fairy.h> | ||
#include <d/tg/d_tg.h> | ||
|
||
class dTgFairy_c : public dTg_c { | ||
public: | ||
dTgFairy_c() {} | ||
virtual ~dTgFairy_c() {} | ||
|
||
virtual bool createHeap() override; | ||
virtual int create() override; | ||
virtual int doDelete() override; | ||
virtual int actorExecute() override; | ||
virtual int draw() override; | ||
|
||
private: | ||
void createFairies(); | ||
mVec3_c calcLocation(const f32 &); | ||
f32 calcRnd(const f32 &, const f32 &); | ||
|
||
dAcRef_c<dAcObjFairy_c> *mpFairyRefs; | ||
s32 mCount; | ||
}; | ||
|
||
#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,77 @@ | ||
#include <c/c_math.h> | ||
#include <d/tg/d_t_fairytag.h> | ||
|
||
SPECIAL_ACTOR_PROFILE(T_FAIRY, dTgFairy_c, fProfile::T_FAIRY, 0x0296, 0, 0); | ||
|
||
bool dTgFairy_c::createHeap() { | ||
mpFairyRefs = new dAcRef_c<dAcObjFairy_c>[mCount](); | ||
return static_cast<bool>(mpFairyRefs); | ||
} | ||
|
||
int dTgFairy_c::create() { | ||
mCount = params & 0x3F; | ||
if (mCount == 0 || mCount == 7) { | ||
mCount = 1; | ||
} | ||
|
||
CREATE_ALLOCATOR(dTgFairy_c); | ||
createFairies(); | ||
return SUCCEEDED; | ||
} | ||
|
||
int dTgFairy_c::doDelete() { | ||
if (mpFairyRefs != nullptr) { | ||
delete[] mpFairyRefs; | ||
mpFairyRefs = nullptr; | ||
} | ||
return SUCCEEDED; | ||
} | ||
|
||
int dTgFairy_c::actorExecute() { | ||
return SUCCEEDED; | ||
} | ||
|
||
int dTgFairy_c::draw() { | ||
return SUCCEEDED; | ||
} | ||
|
||
void dTgFairy_c::createFairies() { | ||
u32 parms = params; | ||
u32 someNum = (parms >> 6) & 0xFF; | ||
u32 fairyParams1 = (parms >> 14) & 0x3F; | ||
if (someNum > 100) { | ||
someNum = 100; | ||
} | ||
|
||
f32 f = 0.01f * someNum; | ||
|
||
for (int i = 0; i < mCount; i++) { | ||
if (mpFairyRefs[i].get() == nullptr) { | ||
// ? | ||
mVec3_c v2; | ||
mVec3_c v = calcLocation(f); | ||
v2 = v; | ||
dAcObjFairy_c *ac = static_cast<dAcObjFairy_c *>( | ||
dAcObjBase_c::create("Fairy", roomid, fairyParams1, &v2, nullptr, nullptr, -1, -1, viewclip_index)); | ||
if (ac != nullptr) { | ||
mpFairyRefs[i].link(ac); | ||
} | ||
} | ||
} | ||
} | ||
|
||
mVec3_c dTgFairy_c::calcLocation(const f32 &offset) { | ||
mVec3_c v; | ||
v.y = scale.y * 0.5f; | ||
v.x = scale.x * calcRnd(0.5f, offset); | ||
v.z = scale.z * calcRnd(0.5f, offset); | ||
v.rotY(rotation.y); | ||
return position + v; | ||
} | ||
|
||
float dTgFairy_c::calcRnd(const f32 &a, const f32 &b) { | ||
f32 f1 = 1.0f - (1.0f - b) * cM::rnd(); | ||
f32 f2 = cM::rndFX(a); | ||
f2 *= f1; | ||
return f2; | ||
} |