summaryrefslogtreecommitdiff
path: root/src/mrsun.cpp
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-03-15 02:54:33 +0100
committerTreeki <treeki@gmail.com>2012-03-15 02:54:33 +0100
commite88fd1dcef52d4375fef655918886fc14bb1f40c (patch)
treef081b14a420331258665a58ad31be54b13b1c655 /src/mrsun.cpp
parent18a6c3dbe01f484b346923ebc53f674c1e4a5101 (diff)
downloadkamek-e88fd1dcef52d4375fef655918886fc14bb1f40c.tar.gz
kamek-e88fd1dcef52d4375fef655918886fc14bb1f40c.zip
optimisations to reduce code size
Diffstat (limited to '')
-rwxr-xr-xsrc/mrsun.cpp33
1 files changed, 2 insertions, 31 deletions
diff --git a/src/mrsun.cpp b/src/mrsun.cpp
index 4e92d7a..ebc33db 100755
--- a/src/mrsun.cpp
+++ b/src/mrsun.cpp
@@ -92,30 +92,23 @@ extern EventTable_t *EventTable;
void daMrSun_c::playerCollision(ActivePhysics *apThis, ActivePhysics *apOther) { DamagePlayer(this, apThis, apOther); }
-void daMrSun_c::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther) { OSReport("Hit Fireball"); }
+void daMrSun_c::collisionCat1_Fireball_E_Explosion(ActivePhysics *apThis, ActivePhysics *apOther) { }
bool daMrSun_c::collisionCat2_IceBall_15_YoshiIce(ActivePhysics *apThis, ActivePhysics *apOther) {
- OSReport("Hit Iceball");
if (this->settings == 1) { // It's a moon
- OSReport("What Kind is it?: %d", apOther->owner->name);
if (apOther->owner->name == 0x76) { // BROS_ICEBALL
- OSReport("No hits 4 u.");
return true;
}
}
- OSReport("K it hit.");
return false;
}
void daMrSun_c::collisionCat9_RollingObject(ActivePhysics *apThis, ActivePhysics *apOther) {
- OSReport("Hit Rolling Object");
this->timer = 0;
doStateChange(&StateID_DieFall); }
void daMrSun_c::collisionCat13_Hammer(ActivePhysics *apThis, ActivePhysics *apOther) {
- OSReport("Hit Hammer");
this->timer = 0;
doStateChange(&StateID_DieFall); }
void daMrSun_c::collisionCat3_StarPower(ActivePhysics *apThis, ActivePhysics *apOther) {
- OSReport("Hit StarMario");
this->timer = 0;
doStateChange(&StateID_DieFall); }
void daMrSun_c::collisionCatD_GroundPound(ActivePhysics *apThis, ActivePhysics *apOther) { DamagePlayer(this, apThis, apOther); }
@@ -169,7 +162,6 @@ void daMrSun_c::dieFall_Execute() {
int daMrSun_c::onCreate() {
- OSReport("Creating the Mr.Sun Models");
allocator.link(-1, GameHeaps[0], 0, 0x20);
if ((this->settings & 0xF) == 0) { // It's a sun
@@ -193,10 +185,8 @@ int daMrSun_c::onCreate() {
allocator.unlink();
- OSReport("Setting Mr.Sun's Size to 4.0");
this->scale = (Vec){0.5, 0.5, 0.5};
- OSReport("Creating Mr.Sun's Physics Struct");
ActivePhysics::Info HitMeBaby;
HitMeBaby.xDistToCenter = 0.0;
@@ -220,11 +210,9 @@ int daMrSun_c::onCreate() {
HitMeBaby.callback = &dEn_c::collisionCallback;
- OSReport("Making the Physics Class and adding to the list");
this->aPhysics.initWithStruct(this, &HitMeBaby);
this->aPhysics.addToList();
- OSReport("Setting up Mr.Sun's Box of Goodies");
this->Baseline = this->pos.y;
this->SwoopSlope = 0.0;
this->SpiralLoop = 0;
@@ -241,16 +229,13 @@ int daMrSun_c::onCreate() {
char eventNum = (this->settings >> 16) & 0xFF;
- OSReport("Event to activate: %d", eventNum);
this->eventFlag = (u64)1 << (eventNum - 1);
- OSReport("Setting Mr.Sun's State");
doStateChange(&StateID_Follow);
- OSReport("Going to Execute Mr.Sun");
this->onExecute();
return true;
}
@@ -260,7 +245,6 @@ int daMrSun_c::onDelete() {
}
int daMrSun_c::onExecute() {
- //OSReport("Oh Mr.Sun, Sun, Mr.Golden Sun");
acState.execute();
updateModelMatrices();
@@ -318,7 +302,6 @@ void daMrSun_c::updateModelMatrices() {
// Follow State
void daMrSun_c::beginState_Follow() {
- OSReport("Mr.Sun is following youuuuu.");
this->timer = 0;
this->rot.x = 18000;
this->rot.y = 0;
@@ -334,7 +317,6 @@ void daMrSun_c::executeState_Follow() {
if ((this->settings & 0xF) == 0) { speedDelta = 0.1; } // It's a sun
else { speedDelta = 0.15; } // It's a moon
-// OSReport("Speed: %f", this->speed.x);
if (this->direction == 0) {
this->speed.x = this->speed.x + speedDelta;
@@ -363,7 +345,6 @@ void daMrSun_c::executeState_Follow() {
this->timer = this->timer + 1;
}
void daMrSun_c::endState_Follow() {
- OSReport("Mr.Sun is coming for you.");
this->speed.y = 0;
}
@@ -371,7 +352,6 @@ void daMrSun_c::endState_Follow() {
// Swoop State
void daMrSun_c::beginState_Swoop() {
- OSReport("Swooping down from above, Mr.Sun falls down.");
// Not enough space to swoop, spit instead.
if (this->swoopTarget.y < (this->pos.y - 50)) { doStateChange(&StateID_Spit); }
@@ -419,7 +399,6 @@ void daMrSun_c::executeState_Swoop() {
}
void daMrSun_c::endState_Swoop() {
- OSReport("Returning to the sky, Mr.Sun flies into the sunset.");
this->speed.y = 0;
}
@@ -428,7 +407,6 @@ void daMrSun_c::endState_Swoop() {
// Spiral State
void daMrSun_c::beginState_Spiral() {
- OSReport("Super Spiral Sunspot!");
this->SpiralLoop = 0;
this->xSpiralOffset = this->pos.x;
@@ -457,7 +435,7 @@ void daMrSun_c::executeState_Spiral() {
if (this->SpiralLoop > (3.14 * Loops)) { doStateChange(&StateID_Follow); }
}
-void daMrSun_c::endState_Spiral() { OSReport("Nightmare Spiral Attack Ends!"); }
+void daMrSun_c::endState_Spiral() { }
@@ -465,7 +443,6 @@ void daMrSun_c::endState_Spiral() { OSReport("Nightmare Spiral Attack Ends!"); }
void daMrSun_c::beginState_Spit() {
- OSReport("Goodness Gracious Great Balls of Fire!");
this->timer = 0;
this->spinStateOn = 1;
@@ -529,7 +506,6 @@ void daMrSun_c::executeState_Spit() {
}
void daMrSun_c::endState_Spit() {
this->spinStateOn = 0;
- OSReport("Armageddon complete.");
}
@@ -537,7 +513,6 @@ void daMrSun_c::endState_Spit() {
// Spin State
void daMrSun_c::beginState_Spin() {
- OSReport("Hoola hoola hoola hoop.");
this->spinReduceZ = 0;
this->spinReduceY = 0;
}
@@ -647,7 +622,6 @@ void daMrSun_c::executeState_Spin() {
}
void daMrSun_c::endState_Spin() {
- OSReport("K, I is dizzy now.");
this->rot.x = 18000;
this->rot.y = 0;
this->rot.z = 0;
@@ -661,7 +635,6 @@ void daMrSun_c::endState_Spin() {
void daMrSun_c::beginState_Wait() {
- OSReport("Preparing an attack!");
this->timer = 0;
this->speed.x = 0.0;
@@ -685,7 +658,6 @@ void daMrSun_c::executeState_Wait() {
Choice = GenerateRandomNumber(9);
-// OSReport("Choice: %d", Choice);
if (Choice == 0) { doStateChange(&StateID_Spit); }
else if (Choice == 1) { doStateChange(&StateID_Spit); }
@@ -698,7 +670,6 @@ void daMrSun_c::executeState_Wait() {
this->timer = this->timer + 1;
}
void daMrSun_c::endState_Wait() {
- OSReport("Mr.Sun Cometh!");
this->timer = 0;
}