r149 - in trunk: . src
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Tue Sep 6 04:34:41 EDT 2005
Author: jonas
Date: 2005-09-06 04:34:41 -0400 (Tue, 06 Sep 2005)
New Revision: 149
Modified:
trunk/TODO
trunk/src/events.cpp
trunk/src/events.h
trunk/src/players_common.cpp
Log:
removed the delanim parameter of all AnimationEvents, fixed the switchPlayer bug
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2005-09-06 08:24:40 UTC (rev 148)
+++ trunk/TODO 2005-09-06 08:34:41 UTC (rev 149)
@@ -2,7 +2,6 @@
====
o rewrite zombie (bug in movement!, attacks too often, use events, etc...)
o memleaks, segfaults?
- o left/right move + switchPlayer (keeps moving)
o key vs. trigger in map2
o fall event (DONE?)
o left/right fallback?
Modified: trunk/src/events.cpp
===================================================================
--- trunk/src/events.cpp 2005-09-06 08:24:40 UTC (rev 148)
+++ trunk/src/events.cpp 2005-09-06 08:34:41 UTC (rev 149)
@@ -52,10 +52,9 @@
delete this;
}
-AnimEvent::AnimEvent(Object* obj, Uint16 length, Uint16 edelay, Uint32 switchstate, Mix_Chunk* asound, EmptyAnimationPtr runanim, bool delanim):
+AnimEvent::AnimEvent(Object* obj, Uint16 length, Uint16 edelay, Uint32 switchstate, Mix_Chunk* asound, EmptyAnimationPtr runanim):
Event(obj,length,edelay,switchstate),
anim(runanim),
- del(delanim),
sound(asound) {
if (anim && anim->isValid()) {
state|=ESTATE_ANIM;
@@ -91,10 +90,9 @@
charowner(chr) { }
//Exactly the same as AnimEvent with Character* instead of Object*
-CAnimEvent::CAnimEvent(Character* chr, Uint16 length, Uint16 edelay, Uint32 switchstate, Mix_Chunk* asound, EmptyAnimationPtr runanim, bool delanim):
+CAnimEvent::CAnimEvent(Character* chr, Uint16 length, Uint16 edelay, Uint32 switchstate, Mix_Chunk* asound, EmptyAnimationPtr runanim):
CEvent(chr,length,edelay,switchstate),
anim(runanim),
- del(delanim),
sound(asound) {
if (anim && anim->isValid()) {
state|=ESTATE_ANIM;
@@ -125,8 +123,8 @@
}
-ERun::ERun(Character* chr, Uint16 length, Sint16 edmax, Uint16 edelay, Uint32 switchstate, Mix_Chunk* esound, EmptyAnimationPtr runanim, bool delanim):
- CAnimEvent(chr,length,edelay,(switchstate|STATE_PRESS_LR),esound,runanim,delanim),
+ERun::ERun(Character* chr, Uint16 length, Sint16 edmax, Uint16 edelay, Uint32 switchstate, Mix_Chunk* esound, EmptyAnimationPtr runanim):
+ CAnimEvent(chr,length,edelay,(switchstate|STATE_PRESS_LR),esound,runanim),
dmax(edmax),
t_reset(0) {
charowner->setState(STATE_RUN);
@@ -165,8 +163,8 @@
}
-EAttack::EAttack(Character* chr, Uint16 length, Weapon* atweapon, Uint16 dir, Uint16 weap_range, Uint16 target_mask, Uint16 edelay, Uint32 switchstate, Mix_Chunk* esound, EmptyAnimationPtr runanim, bool delanim):
- CAnimEvent(chr,length,edelay,switchstate|ESTATE_BUSY,esound,runanim,delanim),
+EAttack::EAttack(Character* chr, Uint16 length, Weapon* atweapon, Uint16 dir, Uint16 weap_range, Uint16 target_mask, Uint16 edelay, Uint32 switchstate, Mix_Chunk* esound, EmptyAnimationPtr runanim):
+ CAnimEvent(chr,length,edelay,switchstate|ESTATE_BUSY,esound,runanim),
weapon(atweapon),
direction(dir),
range(weap_range),
Modified: trunk/src/events.h
===================================================================
--- trunk/src/events.h 2005-09-06 08:24:40 UTC (rev 148)
+++ trunk/src/events.h 2005-09-06 08:34:41 UTC (rev 149)
@@ -60,9 +60,8 @@
/// \param asound Sound (Mix_Chunk) to be played when the event starts
/// \param runanim Animation to be run when the event starts
/// \todo Get rid of the delanim parameter
- /// \param delanim True if the animation should be deleted
AnimEvent(Object* obj, Uint16 length, Uint16 edelay=0, Uint32 switchstate=NOTHING,
- Mix_Chunk* asound=NULL, EmptyAnimationPtr runanim=EmptyAnimationPtr(), bool delanim=false);
+ Mix_Chunk* asound=NULL, EmptyAnimationPtr runanim=EmptyAnimationPtr());
/// \brief Updates the events
/// \return Event state: either delayed (EV_DELAY), starting (EV_START),
/// running (EV_RUN), stopping (EV_END) or canceled (EV_CANCEL)
@@ -72,7 +71,6 @@
virtual void cancel();
protected:
EmptyAnimationPtr anim;
- bool del;
Mix_Chunk* sound;
};
@@ -83,14 +81,13 @@
class CAnimEvent : public CEvent {
public:
CAnimEvent(Character* chr, Uint16 length, Uint16 edelay=0, Uint32 switchstate=NOTHING,
- Mix_Chunk* asound=NULL, EmptyAnimationPtr runanim=EmptyAnimationPtr(), bool delanim=false);
+ Mix_Chunk* asound=NULL, EmptyAnimationPtr runanim=EmptyAnimationPtr());
virtual Uint16 update(Uint16 dt);
virtual void start();
virtual void end();
virtual void cancel();
protected:
EmptyAnimationPtr anim;
- bool del;
Mix_Chunk* sound;
};
@@ -112,11 +109,9 @@
/// \param switchstate States that will be switched when the animation starts/ends
/// \param esound Sound (Mix_Chunk) to be played when the event starts
/// \param runanim Animation to be run when the event starts
- /// \todo Get rid of the delanim parameter
- /// \param delanim True if the animation should be deleted
EAttack(Character* chr, Uint16 length, Weapon* atweapon, Uint16 dir, Uint16 weapon_range=0,
Uint16 target_mask=NOTHING, Uint16 edelay=0, Uint32 switchstate=0, Mix_Chunk* esound=NULL,
- EmptyAnimationPtr runanim=EmptyAnimationPtr(), bool delanim=false);
+ EmptyAnimationPtr runanim=EmptyAnimationPtr());
virtual void end();
protected:
Weapon* weapon;
@@ -134,7 +129,7 @@
public:
/// Adds the initial speed
ERun(Character* chr, Uint16 length, Sint16 edmax, Uint16 edelay=0,
- Uint32 switchstate=0, Mix_Chunk* esound=NULL, EmptyAnimationPtr runanim=EmptyAnimationPtr(), bool delanim=false);
+ Uint32 switchstate=0, Mix_Chunk* esound=NULL, EmptyAnimationPtr runanim=EmptyAnimationPtr());
virtual ~ERun();
/// Forces the event to continue
virtual void start();
Modified: trunk/src/players_common.cpp
===================================================================
--- trunk/src/players_common.cpp 2005-09-06 08:24:40 UTC (rev 148)
+++ trunk/src/players_common.cpp 2005-09-06 08:34:41 UTC (rev 149)
@@ -297,6 +297,8 @@
unsetState(STATE_ACT_2);
unsetState(STATE_ACT_3);
}
+ unsetState(STATE_MLEFT);
+ unsetState(STATE_MRIGHT);
}
Uint16 Player::hit(Uint16 direction, Weapon& weap) {
More information about the lostpenguins-commits
mailing list