summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/mrsun.cpp27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/mrsun.cpp b/src/mrsun.cpp
index b246131..668a789 100755
--- a/src/mrsun.cpp
+++ b/src/mrsun.cpp
@@ -1,24 +1,36 @@
#include <common.h>
-#include <g3dhax.h>
#include <game.h>
+#include <g3dhax.h>
-class dMrSun_c : public dEn_c {
+class daMrSun_c : public dEn_c {
int onCreate();
int onDelete();
int onExecute();
int onDraw();
mHeapAllocator_c allocator;
+ m3d::mdl_c model;
- static dMrSun_c *build();
+ static daMrSun_c *build();
};
+daMrSun_c *daMrSun_c::build() {
+ void *buffer = AllocFromGameHeap1(sizeof(daMrSun_c));
+ return new(buffer) daMrSun_c;
+}
+
#define ACTIVATE 1
#define DEACTIVATE 0
-int dMrSun_c::onCreate() {
+int daMrSun_c::onCreate() {
OSReport("Creating the Mr.Sun Model");
+ allocator.link(-1, GameHeaps[0], 0, 0x20);
+
+ nw4r::g3d::ResFile rf(getResource("g3d/bubble.brres", "bubble"));
+ model.setup(rf.GetResMdl("bubble"), &allocator, 0x224, 1, 0);
+ SetupTextures_Enemy(&model, 0);
+ allocator.unlink();
OSReport("Setting Mr.Sun's Size to 4.0");
this->scale = (Vec){4.0, 4.0, 4.0};
@@ -47,16 +59,17 @@ int dMrSun_c::onCreate() {
return true;
}
-int dMrSun_c::onDelete() {
+int daMrSun_c::onDelete() {
return true;
}
-int dMrSun_c::onExecute() {
+int daMrSun_c::onExecute() {
OSReport("Oh Mr.Sun, Sun, Mr.Golden Sun");
return true;
}
-int dMrSun_c::onDraw() {
+int daMrSun_c::onDraw() {
+ model.scheduleForDrawing();
return true;
}