summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-09-17 04:53:29 +0200
committerTreeki <treeki@gmail.com>2011-09-17 04:53:29 +0200
commitcee981495f3799f92b49809dc3d802b7fce1b248 (patch)
treecf5cfab54ae2b053c601423fe22853ef75b7c483
parent52e163c30e6506d940ff2bcadc5ce01dee81f1dc (diff)
downloadkamek-cee981495f3799f92b49809dc3d802b7fce1b248.tar.gz
kamek-cee981495f3799f92b49809dc3d802b7fce1b248.zip
Mr Sun model rendering fixed
Diffstat (limited to '')
-rwxr-xr-xsrc/mrsun.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/mrsun.cpp b/src/mrsun.cpp
index 3ef27ed..bce5908 100755
--- a/src/mrsun.cpp
+++ b/src/mrsun.cpp
@@ -13,6 +13,8 @@ class daMrSun_c : public dEn_c {
static daMrSun_c *build();
+ void updateModelMatrix();
+
USING_STATES(daMrSun_c);
DECLARE_STATE(Follow);
DECLARE_STATE(Swoop);
@@ -39,7 +41,7 @@ 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"));
+ nw4r::g3d::ResFile rf(getResource("bubble", "g3d/t00.brres"));
model.setup(rf.GetResMdl("bubble"), &allocator, 0x224, 1, 0);
SetupTextures_Enemy(&model, 0);
@@ -79,8 +81,9 @@ int daMrSun_c::onDelete() {
}
int daMrSun_c::onExecute() {
- OSReport("Oh Mr.Sun, Sun, Mr.Golden Sun");
+ //OSReport("Oh Mr.Sun, Sun, Mr.Golden Sun");
acState.execute();
+ updateModelMatrix();
return true;
}
@@ -90,6 +93,17 @@ int daMrSun_c::onDraw() {
}
+void daMrSun_c::updateModelMatrix() {
+ // This won't work with wrap because I'm lazy.
+ matrix.translation(pos.x, pos.y, pos.z);
+ matrix.applyRotationYXZ(&rot.x, &rot.y, &rot.z);
+
+ model.setDrawMatrix(matrix);
+ model.setScale(&scale);
+ model.calcWorld(false);
+}
+
+
void daMrSun_c::beginState_Follow() { }
void daMrSun_c::executeState_Follow() { }