Skip to content

Commit

Permalink
ktOnFire setLight() (#2297)
Browse files Browse the repository at this point in the history
* First commit to repo, basic light function

* various other functions

* Adding .h file

* Added mLight field to daKtOnFire, cleaned up implementation

* Function type fixes
  • Loading branch information
clarkWakeland authored Feb 19, 2025
1 parent c40e255 commit 376a5be
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 29 deletions.
21 changes: 15 additions & 6 deletions include/d/actor/d_a_obj_ktOnFire.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,32 @@ class daKtOnFire_c : public fopAc_ac_c {
/* 8058C960 */ void lightInit();
/* 8058C9D4 */ void setLight();
/* 8058C9F8 */ void cutLight();
/* 8058CA1C */ void Execute();
/* 8058CDF8 */ bool Draw();
/* 8058CE00 */ void Delete();
/* 8058CA1C */ int Execute();
/* 8058CDF8 */ int Draw();
/* 8058CE00 */ int Delete();

static u8 const mCcDObjInfo[48];
static u8 mCcDCyl[68];

private:
/* 0x568 */ u8 field_0x568[0x728 - 0x568];
/* 0x568 */ u8 field_0x568[0x6E4 - 0x568];
/* 0x6E4 */ cXyz mTorchPos;
/* 0x6F0 */ u8 field_0x6E4[0x6FC - 0x6F0];
/* 0x6FC */ cXyz mLightPos;
/* 0x708 */ LIGHT_INFLUENCE mLight;
};

STATIC_ASSERT(sizeof(daKtOnFire_c) == 0x728);

class daKtOnFire_HIO_c {
class daKtOnFire_HIO_c : public mDoHIO_entry_c {
public:
/* 8058C60C */ daKtOnFire_HIO_c();
/* 8058CEA8 */ ~daKtOnFire_HIO_c();
/* 8058CEA8 */ ~daKtOnFire_HIO_c() {}

u8 mTimer;
u8 mColor1R;
u8 mColor1G;
u8 mColor1B;
};


Expand Down
52 changes: 29 additions & 23 deletions src/d/actor/d_a_obj_ktOnFire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ extern "C" void cutLight__12daKtOnFire_cFv();
extern "C" void Execute__12daKtOnFire_cFv();
extern "C" bool Draw__12daKtOnFire_cFv();
extern "C" void Delete__12daKtOnFire_cFv();
extern "C" static void daKtOnFire_Draw__FP12daKtOnFire_c();
extern "C" static void daKtOnFire_Execute__FP12daKtOnFire_c();
extern "C" static void daKtOnFire_Delete__FP12daKtOnFire_c();
extern "C" static void daKtOnFire_Create__FP10fopAc_ac_c();
extern "C" void daKtOnFire_Draw__FP12daKtOnFire_c();
extern "C" void daKtOnFire_Execute__FP12daKtOnFire_c();
extern "C" void daKtOnFire_Delete__FP12daKtOnFire_c();
extern "C" void daKtOnFire_Create__FP10fopAc_ac_c();
extern "C" void __dt__16daKtOnFire_HIO_cFv();
extern "C" void __sinit_d_a_obj_ktOnFire_cpp();
extern "C" u8 const mCcDObjInfo__12daKtOnFire_c[48];
Expand Down Expand Up @@ -161,7 +161,8 @@ extern "C" void __dt__14mDoHIO_entry_cFv() {

/* 8058C678-8058C6D0 000158 0058+00 1/1 0/0 0/0 .text setBaseMtx__12daKtOnFire_cFv */
void daKtOnFire_c::setBaseMtx() {
// NONMATCHING
mDoMtx_stack_c::transS(current.pos.x, current.pos.y, current.pos.z);
mDoMtx_stack_c::ZXYrotM(shape_angle.x, shape_angle.y, shape_angle.z);
}

/* ############################################################################################## */
Expand Down Expand Up @@ -222,16 +223,24 @@ COMPILER_STRIP_GATE(0x8058CFCC, &lit_3798);
/* 8058C960-8058C9D4 000440 0074+00 1/1 0/0 0/0 .text lightInit__12daKtOnFire_cFv */
void daKtOnFire_c::lightInit() {
// NONMATCHING
mLightPos = mTorchPos;
mLightPos.y += lit_3710[0];
mLight.mPosition = mLightPos;
mLight.mColor.r = 0xbc;
mLight.mColor.g = 0x66;
mLight.mColor.b = 0x42;
mLight.mPow = lit_3797;
mLight.mFluctuation = lit_3798;
}

/* 8058C9D4-8058C9F8 0004B4 0024+00 2/2 0/0 0/0 .text setLight__12daKtOnFire_cFv */
void daKtOnFire_c::setLight() {
// NONMATCHING
dKy_plight_set(&mLight);
}

/* 8058C9F8-8058CA1C 0004D8 0024+00 1/1 0/0 0/0 .text cutLight__12daKtOnFire_cFv */
void daKtOnFire_c::cutLight() {
// NONMATCHING
dKy_plight_cut(&mLight);
}

/* ############################################################################################## */
Expand Down Expand Up @@ -263,46 +272,43 @@ static u8 lit_3619[12];
static u8 l_HIO[8];

/* 8058CA1C-8058CDF8 0004FC 03DC+00 1/1 0/0 0/0 .text Execute__12daKtOnFire_cFv */
void daKtOnFire_c::Execute() {
int daKtOnFire_c::Execute() {
// NONMATCHING
return true;
}

/* 8058CDF8-8058CE00 0008D8 0008+00 1/1 0/0 0/0 .text Draw__12daKtOnFire_cFv */
bool daKtOnFire_c::Draw() {
int daKtOnFire_c::Draw() {
return true;
}

/* 8058CE00-8058CE28 0008E0 0028+00 1/1 0/0 0/0 .text Delete__12daKtOnFire_cFv */
void daKtOnFire_c::Delete() {
// NONMATCHING
int daKtOnFire_c::Delete() {
dKy_plight_cut(&mLight);
return true;
}

/* 8058CE28-8058CE48 000908 0020+00 1/0 0/0 0/0 .text daKtOnFire_Draw__FP12daKtOnFire_c
*/
static void daKtOnFire_Draw(daKtOnFire_c* param_0) {
// NONMATCHING
static int daKtOnFire_Draw(daKtOnFire_c* param_0) {
return param_0->Draw();
}

/* 8058CE48-8058CE68 000928 0020+00 1/0 0/0 0/0 .text daKtOnFire_Execute__FP12daKtOnFire_c */
static void daKtOnFire_Execute(daKtOnFire_c* param_0) {
// NONMATCHING
static int daKtOnFire_Execute(daKtOnFire_c* param_0) {
return param_0->Execute();
}

/* 8058CE68-8058CE88 000948 0020+00 1/0 0/0 0/0 .text daKtOnFire_Delete__FP12daKtOnFire_c
*/
static void daKtOnFire_Delete(daKtOnFire_c* param_0) {
// NONMATCHING
static int daKtOnFire_Delete(daKtOnFire_c* param_0) {
return param_0->Delete();
}

/* 8058CE88-8058CEA8 000968 0020+00 1/0 0/0 0/0 .text daKtOnFire_Create__FP10fopAc_ac_c
*/
static void daKtOnFire_Create(fopAc_ac_c* param_0) {
// NONMATCHING
}

/* 8058CEA8-8058CF04 000988 005C+00 2/1 0/0 0/0 .text __dt__16daKtOnFire_HIO_cFv */
daKtOnFire_HIO_c::~daKtOnFire_HIO_c() {
// NONMATCHING
return ((daKtOnFire_c*)param_0)->create();
}

/* 8058CF04-8058CF74 0009E4 0070+00 0/0 1/0 0/0 .text __sinit_d_a_obj_ktOnFire_cpp */
Expand Down

0 comments on commit 376a5be

Please sign in to comment.