summaryrefslogtreecommitdiff
path: root/src/koopatlas/subplayer.cpp
diff options
context:
space:
mode:
authorColin Noga <Tempus@chronometry.ca>2012-11-25 15:35:13 -0600
committerColin Noga <Tempus@chronometry.ca>2012-11-25 15:35:13 -0600
commitdb34c0af338b8cf04f50b4ade98668869fd303e1 (patch)
treee373abe027205c0e8414cf6146ded59112b0ab72 /src/koopatlas/subplayer.cpp
parent72b9b71b5b7fb5757849d19af3dfae21d0ab9c92 (diff)
parent1609b49c5c1777e663909b1936b2f8921677f230 (diff)
downloadkamek-db34c0af338b8cf04f50b4ade98668869fd303e1.tar.gz
kamek-db34c0af338b8cf04f50b4ade98668869fd303e1.zip
Merge branch 'level-select' of ssh://treeki.rustedlogic.net:30000/Kamek into level-select
Diffstat (limited to '')
-rw-r--r--src/koopatlas/subplayer.cpp116
1 files changed, 0 insertions, 116 deletions
diff --git a/src/koopatlas/subplayer.cpp b/src/koopatlas/subplayer.cpp
deleted file mode 100644
index 8f70299..0000000
--- a/src/koopatlas/subplayer.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-#include "koopatlas/player.h"
-#include "koopatlas/subplayer.h"
-
-daWMSubPlayer_c *daWMSubPlayer_c::instance;
-
-int daWMSubPlayer_c::onCreate() {
-
- this->modelHandler = new dPlayerModelHandler_c(settings);
- // loadModel(u8 player_id, int powerup_id, int unk);
- this->modelHandler->loadModel(settings, 3, 2);
- this->modelHandler->mdlClass->startAnimation(0, 1.2, 10.0, 0.0);
- this->modelHandler->setSRT((Vec){0.0,100.0,-100.0}, (S16Vec){0,0,0}, (Vec){2.0,2.0,2.0});
- this->modelHandler->draw();
-
- hammerSuit.setup(this->modelHandler);
-
- pos = (Vec){0.0f,0.0f,3000.0f};
- rot = (S16Vec){0x1800,0,0};
- scale = (Vec){1.6f,1.6f,1.6f};
-
- step = false;
- timer = 0;
-
- return true;
-}
-
-int daWMSubPlayer_c::onDelete() {
- delete modelHandler;
-
- return true;
-}
-
-
-void daWMSubPlayer_c::update(daWMPlayer_c::state_s *st) {
- this->modelHandler->update();
-
- startAnimation(st->anim, st->animFrame, st->animUnk, st->animUpdateRate);
-
- pos = st->pos;
- scale = st->scale;
- rot = st->rot;
-
- mMtx myMatrix;
- myMatrix.scale(scale.x, scale.y, scale.z);
- myMatrix.applyTranslation(pos.x, pos.y + st->jumpOffset, pos.z);
- myMatrix.applyRotationX(&rot.x);
- myMatrix.applyRotationY(&rot.y);
- // Z is unused for now
- modelHandler->setMatrix(myMatrix);
-
- if (st->repeatedEffect) {
- Vec effPos = {pos.x, pos.y, 3300.0f};
- effect.spawn(st->repeatedEffect, 0, &effPos, &rot, &scale);
- }
-
- if (st->repeatedSound) {
- timer++;
-
- if (timer == 12) {
- if (step) { MapSoundPlayer(SoundRelatedClass, st->repeatedSound, 1); step = false; }
- else { MapSoundPlayer(SoundRelatedClass, st->repeatedSound+1, 1); step = true; }
- timer = 0;
- }
-
- if (timer > 12) { timer = 0; }
- }
-
- if (st->nowEffect) {
- SpawnEffect(st->nowEffect, 0, &pos, 0, &scale);
- }
-
- if (st->nowSound != SE_NULL) {
- nw4r::snd::SoundHandle something;
- PlaySoundWithFunctionB4(SoundRelatedClass, &something, st->nowSound, 1);
-
- if (st->nowSound == SE_PLY_JUMP) {
- nw4r::snd::SoundHandle something2;
- PlaySoundWithFunctionB4(SoundRelatedClass, &something2, SE_VOC_MA_CS_JUMP, 1);
- }
- }
-}
-
-int daWMSubPlayer_c::onDraw() {
- if (!visible)
- return true;
-
- this->modelHandler->draw();
- hammerSuit.draw();
-
- return true;
-}
-
-
-void daWMSubPlayer_c::startAnimation(int id, float frame, float unk, float updateRate) {
- if (id == currentAnim && frame == currentFrame && unk == currentUnk && updateRate == currentUpdateRate)
- return;
-
- currentAnim = id;
- currentFrame = frame;
- currentUnk = unk;
- currentUpdateRate = updateRate;
- this->modelHandler->mdlClass->startAnimation(id, frame, unk, updateRate);
-}
-
-
-
-daWMSubPlayer_c *daWMSubPlayer_c::build() {
-
- void *buffer = AllocFromGameHeap1(sizeof(daWMSubPlayer_c));
- daWMSubPlayer_c *c = new(buffer) daWMSubPlayer_c;
-
-
- instance = c;
- return c;
-}
-