summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Simpson <megazig@gmail.com>2011-10-14 19:17:45 -0500
committerStephen Simpson <megazig@gmail.com>2011-10-14 19:17:45 -0500
commita1dbc0a969bf2b55fab8e02c96a0b8d416435f71 (patch)
tree5064af4fca0e19cb13c71656a4768cb1fdb58780
parent51861f825f6c0efd7814309417d038dbb5bc3bba (diff)
downloadkamek-a1dbc0a969bf2b55fab8e02c96a0b8d416435f71.tar.gz
kamek-a1dbc0a969bf2b55fab8e02c96a0b8d416435f71.zip
Tweeks to MG for animations
-rw-r--r--src/bossMegaGoomba.cpp38
1 files changed, 24 insertions, 14 deletions
diff --git a/src/bossMegaGoomba.cpp b/src/bossMegaGoomba.cpp
index 032cfa8..e733f4d 100644
--- a/src/bossMegaGoomba.cpp
+++ b/src/bossMegaGoomba.cpp
@@ -45,7 +45,7 @@ class daMegaGoomba_c : public dEn_c {
bool takeHit(char count);
- void bindAnimChr_and_setUpdateRate(const char* name, int unk, float unk2);
+ void bindAnimChr_and_setUpdateRate(const char* name, int unk, float unk2, float rate);
void dieFall_Begin();
void dieFall_Execute();
@@ -170,15 +170,16 @@ void daMegaGoomba_c::_vf120(ActivePhysics *apThis, ActivePhysics *apOther) { OSR
void daMegaGoomba_c::_vf110(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("_vf110:\n"); }
void daMegaGoomba_c::_vf108(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("_vf108:\n"); }
-void daMegaGoomba_c::bindAnimChr_and_setUpdateRate(const char* name, int unk, float unk2) {
+void daMegaGoomba_c::bindAnimChr_and_setUpdateRate(const char* name, int unk, float unk2, float rate) {
nw4r::g3d::ResAnmChr anmChr = this->resFile.GetResAnmChr(name);
this->animationChr.bind(&this->bodyModel, anmChr, unk);
this->bodyModel.bindAnim(&this->animationChr, unk2);
- this->animationChr.setUpdateRate(1.0);
+ this->animationChr.setUpdateRate(rate);
}
void daMegaGoomba_c::dieFall_Begin() {
- //this->bindAnimChr_and_setUpdateRate("split", 0, 0.0);
+ // DOESN'T LOOK GOOD
+ //this->bindAnimChr_and_setUpdateRate("damage", 0, 0.0, 1.0);
//dSprite_c::dieFall_Begin();
}
//TODO make this real perty like
@@ -199,7 +200,11 @@ void HexDump(char* address, u32 length) {
char line[0x11] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
for(u32 ii=0; ii < length; ii += 0x10) {
for(u32 jj=0; jj < 0x10; jj++) {
- line[jj] = address[ii+jj];
+ if((address[ii+jj] < 0x20) || (address[ii+jj] > 0x7e)) {
+ line[jj] = '.';
+ }else{
+ line[jj] = address[ii+jj];
+ }
}
OSReport("%08x: %04x %04x %04x %04x %04x %04x %04x %04x |%s|\n",
(u32)(address+ii),
@@ -227,7 +232,6 @@ void daMegaGoomba_c::setupBodyModel() {
bool ret;
nw4r::g3d::ResAnmChr anmChr = this->resFile.GetResAnmChr("walk");
ret = this->animationChr.setup(mdl, anmChr, &this->allocator, 0);
- this->bodyModel.bindAnim(&this->animationChr, 0.0);
nw4r::g3d::ResAnmTexPat anmPat = this->resFile.GetResAnmTexPat("walk");
this->resTexPat = anmPat;
@@ -323,14 +327,13 @@ int daMegaGoomba_c::onExecute() {
int daMegaGoomba_c::onDraw() {
bodyModel.scheduleForDrawing();
bodyModel._vf1C();
- //animationChr.process();
animationPat.process();
return true;
}
void daMegaGoomba_c::updateModelMatrices() {
- // Bounds checking
+ // Bounds checking // move to onExecute();
// TODO possibly change to a state change
if(this->life > 0) {
if(this->pos.x < this->Bounding.left) {
@@ -410,6 +413,9 @@ void daMegaGoomba_c::beginState_Shrink() {
keysX[1] = (HermiteKey){ 20.0, this->scale.x - 2.0, 1.0 };
keysX[2] = (HermiteKey){ 40.0, this->scale.x, 1.0 };
keysX[3] = (HermiteKey){ 59.0, this->scale.x - 2.0, 1.0 };
+
+ // using this to stop walk animation
+ this->animationChr.setCurrentFrame(600.0);
}
void daMegaGoomba_c::executeState_Shrink() {
this->timer += 1.0;
@@ -430,6 +436,10 @@ void daMegaGoomba_c::endState_Shrink() { }
// Launch State - Launches some small goombas up in arcs
void daMegaGoomba_c::beginState_Launch() {
this->timer = 0.0;
+ rot.y = 0x0;
+
+ // using this to stop walk animation
+ this->animationChr.setCurrentFrame(600.0);
}
void daMegaGoomba_c::executeState_Launch() {
@@ -497,6 +507,8 @@ void daMegaGoomba_c::beginState_Jump() {
keysX[1] = (HermiteKey){ fullTime, this->pos.x + delta, 0.0 };
keysY[2] = (HermiteKey){ fullTime, this->pos.y, 0.8 };
+ // using this to stop walk animation
+ this->animationChr.setCurrentFrame(600.0);
}
void daMegaGoomba_c::executeState_Jump() {
@@ -521,15 +533,12 @@ void daMegaGoomba_c::beginState_Walk() {
rot.y = (this->direction) ? 0xe000 : 0x2000;
//SETUP WALK ANIMATION//
- nw4r::g3d::ResAnmChr anmChr = this->resFile.GetResAnmChr("walk");
- this->animationChr.bind(&this->bodyModel, anmChr, 1);
- this->bodyModel.bindAnim(&this->animationChr, 0.0);
- this->animationChr.setUpdateRate(1.0);
- //OSReport("Current anmChr frame: %f\n", this->animationChr.getCurrentFrame());
- //OSReport("Is animation done? %d\n", this->animationChr.isAnimationDone());
+ bindAnimChr_and_setUpdateRate("walk", 1, 0.0, 1.0);
+
this->bodyModel.bindAnim(&this->animationPat, 0.0);
this->animationPat.setUpdateRateForEntry(1.0, 0);
this->animationPat.setEntryByte34(0, 0);
+
float num = (float)GenerateRandomNumber(0xB4);
this->animationPat.setFrameForEntry(num, 0);
}
@@ -543,6 +552,7 @@ void daMegaGoomba_c::executeState_Walk() {
Vec vctr;
ConvertMatrixToTranslationVector(&mtx, &vctr);
*/
+ // USE THIS FOR STATE CHANGES
if(this->animationChr.isAnimationDone())
this->animationChr.setCurrentFrame(0.0);