Skip to content

Commit

Permalink
create d_a_t_wood_area header
Browse files Browse the repository at this point in the history
  • Loading branch information
elijah-thomas774 committed Jun 15, 2024
1 parent 4ad761b commit 2a16b01
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 42 deletions.
48 changes: 48 additions & 0 deletions include/d/a/d_a_t_wood_area.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#ifndef D_A_T_WOOD_AREA_H
#define D_A_T_WOOD_AREA_H

#include <d/a/obj/d_a_obj_base.h>
#include <d/d_player.h>
#include <f/f_list_nd.h>
#include <s/s_State.hpp>
#include <s/s_StateMgr.hpp>

class dAcTWoodArea_c : public dAcObjBase_c {
public:
dAcTWoodArea_c() : mStateMgr(*this, sStateID::null) {}
virtual ~dAcTWoodArea_c() {}
virtual int actorCreate() override;
virtual int actorPostCreate() override;
virtual int actorExecute() override;
virtual int draw() override;
virtual int doDelete() override;

STATE_FUNC_DECLARE(dAcTWoodArea_c, Init);
STATE_FUNC_DECLARE(dAcTWoodArea_c, Wait);

void attachCloseObjects(ProfileName profID);
void dropItems();
bool attachObject(dAcObjBase_c *obj);

f32 getAttachRadius() {
return scale.x * scaleX;
}
f32 getAttachRadiusSquare() {
return getAttachRadius() * getAttachRadius();
}
f32 getAttachHeight() {
return scale.y * scaleY;
}

static const f32 scaleX;
static const f32 scaleY;

private:
STATE_MGR_DECLARE(dAcTWoodArea_c);

dAcRef_c<dAcObjBase_c> mRefs[8];
};

// {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};

#endif
44 changes: 2 additions & 42 deletions src/REL/d/a/d_a_t_wood_area.cpp
Original file line number Diff line number Diff line change
@@ -1,45 +1,4 @@
#include <d/a/obj/d_a_obj_base.h>
#include <d/d_player.h>
#include <f/f_list_nd.h>
#include <s/s_State.hpp>
#include <s/s_StateMgr.hpp>

class dAcTWoodArea_c : public dAcObjBase_c {
public:
dAcTWoodArea_c() : mStateMgr(*this, sStateID::null) {}
virtual ~dAcTWoodArea_c() {}
virtual int actorCreate() override;
virtual int actorPostCreate() override;
virtual int actorExecute() override;
virtual int draw() override;
virtual int doDelete() override;

void attachCloseObjects(ProfileName profID);
void dropItems();
bool attachObject(dAcObjBase_c *obj);

f32 getAttachRadius() {
return scale.x * scaleX;
}
f32 getAttachRadiusSquare() {
return getAttachRadius() * getAttachRadius();
}

f32 getAttachHeight() {
return scale.y * scaleY;
}

STATE_FUNC_DECLARE(dAcTWoodArea_c, Init);
STATE_FUNC_DECLARE(dAcTWoodArea_c, Wait);

static const f32 scaleX;
static const f32 scaleY;

private:
STATE_MGR_DECLARE(dAcTWoodArea_c);

dAcRef_c<dAcObjBase_c> mRefs[8];
};
#include <d/a/d_a_t_wood_area.h>

const f32 dAcTWoodArea_c::scaleX = 100.0f;
const f32 dAcTWoodArea_c::scaleY = 100.0f;
Expand Down Expand Up @@ -95,6 +54,7 @@ extern "C" void fn_800298B0(u16, mVec3_c *, mAng3_c *, u32, u32, u32, u32, u32);
extern u16 PARTICLE_RESOURCE_ID_MAPPING[];

void dAcTWoodArea_c::initializeState_Wait() {}

void dAcTWoodArea_c::executeState_Wait() {
if (dPlayer::LINK != nullptr && (dPlayer::LINK->someFlags & 0x2000)) {
// This is a bit messed up
Expand Down

0 comments on commit 2a16b01

Please sign in to comment.