r151 - in trunk: . src src/objects

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Tue Sep 6 07:07:57 EDT 2005


Author: jonas
Date: 2005-09-06 07:07:57 -0400 (Tue, 06 Sep 2005)
New Revision: 151

Modified:
   trunk/TODO
   trunk/src/common.cpp
   trunk/src/objects/baleog.cpp
   trunk/src/objects/baleog.h
   trunk/src/objects/erik.cpp
   trunk/src/objects/erik.h
   trunk/src/objects/fang.cpp
   trunk/src/objects/fang.h
   trunk/src/objects/olaf.cpp
   trunk/src/objects/olaf.h
   trunk/src/objects/scorch.cpp
   trunk/src/objects/scorch.h
   trunk/src/objects/zombie.cpp
   trunk/src/objects/zombie.h
Log:
enable debug with -DEBUG, added destructors again => fixes bug

Modified: trunk/TODO
===================================================================
--- trunk/TODO	2005-09-06 09:34:31 UTC (rev 150)
+++ trunk/TODO	2005-09-06 11:07:57 UTC (rev 151)
@@ -4,7 +4,6 @@
  o memleaks, segfaults?
  o key vs. trigger in map2
  o fall event (DONE?)
- o left/right fallback?
  o players die event segfault (eg. olaf)
 
 
@@ -24,8 +23,16 @@
        concrete class depending on the game_mode instead of using if...
 
  o Move/Fall/push/crash/collisions:
-     o the character should have more information what he hits
-     o IDEA: movements into dense objects should involve a push()
+     o move should be a property of a common object
+     o Hit should give either much more information or all logic should be done inside
+       move (BAD)
+     o collision reactions should depend on the corresponding types and whether we
+       already are near the object or not => getCollisionType(obj1,obj2)?
+     o First priority (first run): find out where the object will move to (HARD)
+       => add a bool notchange parameter and pass it on to all actions
+     o movement into a movable object should just move the object
+     o if the movement is "forced" the moved object should be hit hard when it collides
+       otherwise a hit would stop the moving object as well...
        -> I have no idea about how the push should look like, elevators can be pushed
           up, even though you don't collide with them on top
        -> characters should be "pushable", eg. a stone that falls down pushes the
@@ -82,9 +89,9 @@
 
  o Monsters / AI: VERY BAD
  o Game functionality (): BAD
+ o Events / Effects: BAD, MESS
  o Object (including parameter) loading: BAD
- o Move logic: BAD, BUGGED, MESS
- o Events / Effects: BAD, MESS
+ o Move logic: ACCEPTABLE, BUGGED
  o Objects (players, items, etc): ACCEPTABLE
  o Input Handler: ACCEPTABLE, WORKS
  o Collision detection: OK

Modified: trunk/src/common.cpp
===================================================================
--- trunk/src/common.cpp	2005-09-06 09:34:31 UTC (rev 150)
+++ trunk/src/common.cpp	2005-09-06 11:07:57 UTC (rev 151)
@@ -51,6 +51,9 @@
         gfxeng->unsetShowDebug();
         SDL_ShowCursor(SDL_DISABLE);
     }
+#ifdef DEBUG
+    gfxeng->setShowDebug();
+#endif
 }
 
 void addGameMode(Uint8 addmode) {

Modified: trunk/src/objects/baleog.cpp
===================================================================
--- trunk/src/objects/baleog.cpp	2005-09-06 09:34:31 UTC (rev 150)
+++ trunk/src/objects/baleog.cpp	2005-09-06 11:07:57 UTC (rev 151)
@@ -22,6 +22,8 @@
     au_sword=scenario->sndcache->loadWAV("swrdsw2.wav");
 }
 
+Baleog::~Baleog() { }
+
 //Baleog1: Sword attack
 void Baleog::in_sp1() {
     setEvent(new EAttack(this,10,&weapon,(state&STATE_LEFT) ? DIR_LEFT : DIR_RIGHT,10,enemy_types,0,0,au_sword,(state&STATE_LEFT) ? anim_sword_left : anim_sword_right));

Modified: trunk/src/objects/baleog.h
===================================================================
--- trunk/src/objects/baleog.h	2005-09-06 09:34:31 UTC (rev 150)
+++ trunk/src/objects/baleog.h	2005-09-06 11:07:57 UTC (rev 151)
@@ -6,6 +6,7 @@
 class Baleog : public Player {
     public:
         Baleog(string imagename, Sint16 xpos=0, Sint16 ypos=0, string name="Baleog");
+        virtual ~Baleog();
         /// \brief Baleog attacks with a sword
         virtual void in_sp1();
     private:

Modified: trunk/src/objects/erik.cpp
===================================================================
--- trunk/src/objects/erik.cpp	2005-09-06 09:34:31 UTC (rev 150)
+++ trunk/src/objects/erik.cpp	2005-09-06 11:07:57 UTC (rev 151)
@@ -36,8 +36,8 @@
     anim_fall_right=loadAnimation("erik_fall_right",config.lvlscale,BP_LD);
     anim_fall_fast_left=loadAnimation("erik_fall_fast_left",config.lvlscale,BP_RD);
     anim_fall_fast_right=loadAnimation("erik_fall_fast_right",config.lvlscale,BP_LD);
-    anim_crash_left=loadAnimation("erik_crash_left",config.lvlscale,BP_RD,ATYPE_ONCE_END,calcFPS(1,T_IRR));
-    anim_crash_right=loadAnimation("erik_crash_right",config.lvlscale,BP_LD,ATYPE_ONCE_END,calcFPS(1,T_IRR));
+    anim_crash_left=loadAnimation("erik_crash_left",config.lvlscale,BP_RD,ATYPE_ONCE_END);
+    anim_crash_right=loadAnimation("erik_crash_right",config.lvlscale,BP_LD,ATYPE_ONCE_END);
     anim_rope_left=loadAnimation("erik_rope_left",config.lvlscale,BP_RD);
     anim_rope_right=loadAnimation("erik_rope_right",config.lvlscale,BP_LD);
     anim_teleport_left=loadAnimation("erik_teleport_left",config.lvlscale,BP_RD,ATYPE_ONCE_END);
@@ -75,6 +75,8 @@
     au_run=NULL;
 }
 
+Erik::~Erik() { }
+
 void Erik::idle(Uint16 dt) {
     Player::idle(dt);
     //TODO: this is an ugly hack...

Modified: trunk/src/objects/erik.h
===================================================================
--- trunk/src/objects/erik.h	2005-09-06 09:34:31 UTC (rev 150)
+++ trunk/src/objects/erik.h	2005-09-06 11:07:57 UTC (rev 151)
@@ -14,6 +14,7 @@
 class Erik : public Player {
     public:
         Erik(string imagename, Sint16 xpos=0, Sint16 ypos=0, string name="Erik");
+        virtual ~Erik();
         virtual void idle(Uint16); 
        /// \brief Erik jumps
         virtual void in_sp1();

Modified: trunk/src/objects/fang.cpp
===================================================================
--- trunk/src/objects/fang.cpp	2005-09-06 09:34:31 UTC (rev 150)
+++ trunk/src/objects/fang.cpp	2005-09-06 11:07:57 UTC (rev 151)
@@ -25,6 +25,8 @@
     au_jump=scenario->sndcache->loadWAV("fangjump.wav");
 }
 
+Fang::~Fang() { }
+
 void Fang::in_left(Uint16 dt) {
     Player::in_left(dt);
     unsetState(STATE_CLIMB_R);

Modified: trunk/src/objects/fang.h
===================================================================
--- trunk/src/objects/fang.h	2005-09-06 09:34:31 UTC (rev 150)
+++ trunk/src/objects/fang.h	2005-09-06 11:07:57 UTC (rev 151)
@@ -23,6 +23,7 @@
 class Fang : public Player {
     public:
         Fang(string imagename, Sint16 xpos=0, Sint16 ypos=0, string name="Fang");
+        virtual ~Fang();
         virtual void fall(Uint16);
         virtual void in_left(Uint16);
         virtual void in_right(Uint16);

Modified: trunk/src/objects/olaf.cpp
===================================================================
--- trunk/src/objects/olaf.cpp	2005-09-06 09:34:31 UTC (rev 150)
+++ trunk/src/objects/olaf.cpp	2005-09-06 11:07:57 UTC (rev 151)
@@ -36,6 +36,8 @@
     au_hit=scenario->sndcache->loadWAV("fathit.wav");
 }
 
+Olaf::~Olaf() { }
+
 void Olaf::updateAnimState() {
     if (state&STATE_SMALL) {
         if (state&STATE_LEFT) {

Modified: trunk/src/objects/olaf.h
===================================================================
--- trunk/src/objects/olaf.h	2005-09-06 09:34:31 UTC (rev 150)
+++ trunk/src/objects/olaf.h	2005-09-06 11:07:57 UTC (rev 151)
@@ -17,6 +17,7 @@
 class Olaf : public Player {
     public:
         Olaf(string imagename, Sint16 xpos=0, Sint16 ypos=0, string name="Olaf");
+        virtual ~Olaf();
         /// Additionally checks if Olaf is small and how he wears his shield
         virtual void updateAnimState();
         virtual void in_left(Uint16);

Modified: trunk/src/objects/scorch.cpp
===================================================================
--- trunk/src/objects/scorch.cpp	2005-09-06 09:34:31 UTC (rev 150)
+++ trunk/src/objects/scorch.cpp	2005-09-06 11:07:57 UTC (rev 151)
@@ -23,6 +23,8 @@
     au_hit=scenario->sndcache->loadWAV("draghit.wav");
 }
 
+Scorch::~Scorch() { }
+
 void Scorch::idle(Uint16 dt) {
     Player::idle(dt);
     if (!input->keyState(KEY_SP1)) {

Modified: trunk/src/objects/scorch.h
===================================================================
--- trunk/src/objects/scorch.h	2005-09-06 09:34:31 UTC (rev 150)
+++ trunk/src/objects/scorch.h	2005-09-06 11:07:57 UTC (rev 151)
@@ -17,6 +17,7 @@
 class Scorch : public Player {
     public:
         Scorch(string imagename, Sint16 xpos=0, Sint16 ypos=0, string name="Scorch");
+        virtual ~Scorch();
         virtual void fall(Uint16);
         /// \brief Scorch uses his wings
         virtual void idle(Uint16);

Modified: trunk/src/objects/zombie.cpp
===================================================================
--- trunk/src/objects/zombie.cpp	2005-09-06 09:34:31 UTC (rev 150)
+++ trunk/src/objects/zombie.cpp	2005-09-06 11:07:57 UTC (rev 151)
@@ -20,6 +20,8 @@
     weapon=Weapon(-1,W_STRIKE);
 }
 
+Zombie::~Zombie() { }
+
 void Zombie::idle(Uint16 dt) {
     Character::idle(dt);
     runAI(dt);

Modified: trunk/src/objects/zombie.h
===================================================================
--- trunk/src/objects/zombie.h	2005-09-06 09:34:31 UTC (rev 150)
+++ trunk/src/objects/zombie.h	2005-09-06 11:07:57 UTC (rev 151)
@@ -9,6 +9,7 @@
 class Zombie : public Monster {
     public:
         Zombie(string imagename, Sint16 xpos=0, Sint16 ypos=0, string name="Zombie");
+        virtual ~Zombie();
         virtual void idle(Uint16);
     private:
         virtual void runAI(Uint16);




More information about the lostpenguins-commits mailing list