NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
d_a_obj_fruit_tree.hpp
1#pragma once
2#include <game/bases/d_enemy.hpp>
3#include <game/bases/d_heap_allocator.hpp>
4
5/**
6 * @brief A decorative leafy bush used for Yoshi fruits.
7 * @ingroup bases
8 * @details The actor can be placed in layer 2.
9 * @paramtable
10 * @bug Bushes with sizes larger than #SIZE_SMALL spawn too late when approached from above due
11 * to the bounding box not being updated.
12 */
13class daObjFruitTree_c : public dEn_c {
14public:
15
16 /// @brief The possible bush styles.
17 enum STYLE_e {
18 STYLE_REGULAR, ///< The regular bush style.
19 STYLE_MOUNTAIN, ///< The mountain bush style, with a yellow-ish color.
20 };
21
22 /// @brief The possible bush sizes.
23 enum SIZE_e {
24 SIZE_SMALL,
25 SIZE_MEDIUM,
26 SIZE_LARGE,
27 SIZE_EXTRA_LARGE,
28 };
29
30 daObjFruitTree_c() {} ///< Creates a new daObjFruitTree_c.
31
32 virtual int create();
33 virtual int doDelete();
34 virtual int execute();
35 virtual int draw();
36 virtual ~daObjFruitTree_c() {} ///< Deletes the daObjFruitTree_c.
37
38 void createBushAnim(nw4r::g3d::ResMdl resMdl, nw4r::g3d::ResAnmChr animChr) {
39 mBushAnim.create(resMdl, animChr, &mHeapAllocator);
40 }
41
42 dHeapAllocator_c mHeapAllocator; ///< The allocator.
43 nw4r::g3d::ResFile mResFile; ///< The resource file.
44 m3d::mdl_c mBushModel; ///< The bush model.
45 m3d::anmChr_c mBushAnim; ///< The bush model animation.
46
47 ACTOR_PARAM_CONFIG(Size, 0, 4); ///< The size of the bush. @see SIZE_e
48 ACTOR_PARAM_CONFIG(Style, 4, 4); ///< The style of the bush. @see STYLE_e
49};
dEn_c()
Constructs a new enemy actor.
Definition d_enemy.cpp:28
nw4r::g3d::ResFile mResFile
The resource file.
virtual int create()
do method for the create operation.
m3d::anmChr_c mBushAnim
The bush model animation.
STYLE_e
The possible bush styles.
@ STYLE_REGULAR
The regular bush style.
@ STYLE_MOUNTAIN
The mountain bush style, with a yellow-ish color.
virtual int doDelete()
do method for the delete operation.
virtual ~daObjFruitTree_c()
Deletes the daObjFruitTree_c.
virtual int draw()
do method for the draw operation.
m3d::mdl_c mBushModel
The bush model.
ACTOR_PARAM_CONFIG(Size, 0, 4)
The size of the bush.
ACTOR_PARAM_CONFIG(Style, 4, 4)
The style of the bush.
dHeapAllocator_c mHeapAllocator
The allocator.
virtual int execute()
do method for the execute operation.
SIZE_e
The possible bush sizes.
daObjFruitTree_c()
Creates a new daObjFruitTree_c.