- Timestamp:
- Apr 13, 2005, 11:08:43 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 6 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/Makefile.am
r3796 r3812 34 34 track_node.cc \ 35 35 animation.cc \ 36 animation_player.cc \ 36 37 simple_animation.cc \ 37 38 garbage_collector.cc \ … … 85 86 track_node.h \ 86 87 animation.h \ 88 animation_player.h \ 87 89 simple_animation.h \ 88 90 garbage_collector.h \ -
orxonox/trunk/src/Makefile.in
r3796 r3812 56 56 command_node.$(OBJEXT) keynames.$(OBJEXT) camera.$(OBJEXT) \ 57 57 track_manager.$(OBJEXT) track_node.$(OBJEXT) \ 58 animation.$(OBJEXT) simple_animation.$(OBJEXT) \59 garbage_collector.$(OBJEXT) story_entity.$(OBJEXT) \60 campaign.$(OBJEXT) world.$(OBJEXT) world_entity.$(OBJEXT) \61 player.$(OBJEXT) environment.$(OBJEXT) skysphere.$(OBJEXT) \62 sky box.$(OBJEXT) terrain.$(OBJEXT) weapon.$(OBJEXT) \63 projectile.$(OBJEXT) satellite.$(OBJEXT) \58 animation.$(OBJEXT) animation_player.$(OBJEXT) \ 59 simple_animation.$(OBJEXT) garbage_collector.$(OBJEXT) \ 60 story_entity.$(OBJEXT) campaign.$(OBJEXT) world.$(OBJEXT) \ 61 world_entity.$(OBJEXT) player.$(OBJEXT) environment.$(OBJEXT) \ 62 skysphere.$(OBJEXT) skybox.$(OBJEXT) terrain.$(OBJEXT) \ 63 weapon.$(OBJEXT) projectile.$(OBJEXT) satellite.$(OBJEXT) \ 64 64 character_attributes.$(OBJEXT) test_gun.$(OBJEXT) \ 65 65 test_bullet.$(OBJEXT) ai.$(OBJEXT) p_node.$(OBJEXT) \ … … 77 77 am__depfiles_maybe = depfiles 78 78 @AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/ai.Po ./$(DEPDIR)/animation.Po \ 79 @AMDEP_TRUE@ ./$(DEPDIR)/animation_player.Po \ 79 80 @AMDEP_TRUE@ ./$(DEPDIR)/array.Po ./$(DEPDIR)/base_entity.Po \ 80 81 @AMDEP_TRUE@ ./$(DEPDIR)/base_object.Po ./$(DEPDIR)/camera.Po \ … … 246 247 track_node.cc \ 247 248 animation.cc \ 249 animation_player.cc \ 248 250 simple_animation.cc \ 249 251 garbage_collector.cc \ … … 297 299 track_node.h \ 298 300 animation.h \ 301 animation_player.h \ 299 302 simple_animation.h \ 300 303 garbage_collector.h \ … … 422 425 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ai.Po@am__quote@ 423 426 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/animation.Po@am__quote@ 427 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/animation_player.Po@am__quote@ 424 428 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array.Po@am__quote@ 425 429 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base_entity.Po@am__quote@ -
orxonox/trunk/src/animation.cc
r3798 r3812 17 17 #include "animation.h" 18 18 #include "debug.h" 19 #include "animation_player.h" 19 20 20 21 … … 27 28 this->localTime = 0.0; 28 29 this->bRunning = true; 30 31 AnimationPlayer::getInstance()->addAnimation(this); 29 32 } 30 33 -
orxonox/trunk/src/animation_player.cc
r3807 r3812 1 2 3 1 /* 4 2 orxonox - the future of 3D-vertical-scrollers … … 12 10 13 11 ### File Specific: 14 main-programmer: ...12 main-programmer: Benjamin Grauer 15 13 co-programmer: ... 16 14 */ 17 15 18 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_ WORLD_ENTITY16 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_ANIM 19 17 20 #include "proto_class.h" 21 22 #include "stdincl.h" // maybe 18 #include "animation_player.h" 23 19 24 20 using namespace std; … … 27 23 /** 28 24 \brief standard constructor 29 \todo this constructor is not jet implemented - do it30 25 */ 31 ProtoClass::ProtoClass()26 AnimationPlayer::AnimationPlayer () 32 27 { 33 this->setClassName ("ProtoClass"); 28 this->setClassName ("AnimationPlayer"); 29 30 this->animationList = new tList<Anim>(); 34 31 } 35 32 33 /** 34 \brief the singleton reference to this class 35 */ 36 AnimationPlayer* AnimationPlayer::singletonRef = NULL; 37 38 /** 39 \returns a Pointer to this Class 40 */ 41 AnimationPlayer* AnimationPlayer::getInstance(void) 42 { 43 if (!AnimationPlayer::singletonRef) 44 AnimationPlayer::singletonRef = new AnimationPlayer(); 45 return AnimationPlayer::singletonRef; 46 } 36 47 37 48 /** 38 49 \brief standard deconstructor 39 50 51 !! DANGER !! when unloading the AnimationPlayer no other Function 52 should reference any Animations, because it automatically deletes 53 them. This usually happens when unloading a World. 40 54 */ 41 ProtoClass::~ProtoClass()55 AnimationPlayer::~AnimationPlayer () 42 56 { 43 // delete what has to be deleted here 57 // deleting the Animation List AND all the elements of the List 58 tIterator<Anim>* animIt = animationList->getIterator(); 59 Anim* anim = animIt->nextElement(); 60 while( anim != NULL) 61 { 62 delete anim; 63 anim = animIt->nextElement(); 64 } 65 delete animIt; 66 delete this->animationList; 67 68 AnimationPlayer::singletonRef = NULL; 44 69 } 45 70 46 71 /** 47 \brief nonsense - delete this method 48 \param realy nothing to give 49 \returns true or false - probably nothing? 72 \brief adds an Animation to the AnimationList. 73 \param animation the Animation to handle 50 74 51 this is just to show the doxygen abilities (this for example is an extension for a long comment) 75 when adding a Animation the Animation will too be deleted when 76 the AnimationPlayer gets deleted. Consider not adding it, or 77 unadding it with animation->notHandled(); 52 78 */ 53 bool ProtoClass::doNonSense (int nothing) {} 79 void AnimationPlayer::addAnimation(Anim* animation) 80 { 81 this->animationList->add(animation); 82 } 83 84 /** 85 \brief Ticks all the animations in animationList 86 \param timePassed the time passed since the last tick. 87 */ 88 void AnimationPlayer::tick(float timePassed) 89 { 90 tIterator<Anim>* animIt = animationList->getIterator(); 91 Anim* anim = animIt->nextElement(); 92 while( anim != NULL) 93 { 94 anim->tick(timePassed); 95 anim = animIt->nextElement(); 96 } 97 delete animIt; 98 99 } -
orxonox/trunk/src/animation_player.h
r3807 r3812 1 1 /*! 2 \file proto_class.h 3 \brief Definition of the proto class template, used quickly start work 4 \todo Example: this shows how to use simply add a Marker that here has to be done something. 5 6 The Protoclass exists, to help you quikly getting the run for how to develop in orxonox. 7 It is an example for the CODING-CONVENTION, and a starting-point for every class. 2 \file animation_player.h 8 3 */ 9 4 10 #ifndef _ PROTO_CLASS_H11 #define _ PROTO_CLASS_H5 #ifndef _ANIMATION_PLAYER_H 6 #define _ANIMATION_PLAYER_H 12 7 13 #include "what realy has to be included"14 8 #include "base_object.h" 9 #include "animation.h" 15 10 16 // FORWARD DEFINITION \\ 17 class someClassWeNeed; 11 /* FORWARD DEFINITION */ 12 13 //! A AnimationPlayer, that handles the animation of all the Animations in the scene. 14 class AnimationPlayer : public BaseObject { 15 16 public: 17 static AnimationPlayer* getInstance(void); 18 virtual ~AnimationPlayer(void); 19 20 void addAnimation(Anim* animation); 21 22 void tick(float timePassed); 23 24 private: 25 /* singleton */ 26 AnimationPlayer(void); 27 static AnimationPlayer* singletonRef; 28 29 /* class specific */ 30 tList<Anim>* animationList; //!< A List of Animations to be handled 31 }; 18 32 19 33 20 /*class Test;*/ /* forward definition of class Test (without including it here!)*/ 21 22 //! A default class that aids you to start creating a new class 23 /** 24 here can be some longer description of this class 25 */ 26 class ProtoClass : public BaseObject { 27 28 public: 29 ProtoClass(); 30 virtual ~ProtoClass(); 31 32 bool doNonSense (int nothing); 33 34 private: 35 int nonSense; //!< doxygen tag here like this for all the variables - delete this variable if you use this 36 37 }; 38 39 #endif /* _PROTO_CLASS_H */ 34 #endif /* _ANIMATION_PLAYER_H */ -
orxonox/trunk/src/defs/debug.h
r3790 r3812 72 72 #define DEBUG_MODULE_MATH 0 73 73 #define DEBUG_MODULE_FONT 4 74 #define DEBUG_MODULE_ANIM 3 74 75 75 76 #define DEBUG_MODULE_NULL_PARENT 0 -
orxonox/trunk/src/story_entities/world.cc
r3810 r3812 39 39 #include "garbage_collector.h" 40 40 #include "simple_animation.h" 41 #include "animation .h"41 #include "animation_player.h" 42 42 43 43 #include "command_node.h" … … 162 162 163 163 delete this->simpleAnimation; 164 delete AnimationPlayer::getInstance(); // this should be at the end of the unloading sequence. 164 165 //delete garbagecollecor 165 166 //delete animator … … 184 185 this->debugWorldNr = worldID; 185 186 this->entities = new tList<WorldEntity>(); 187 AnimationPlayer::getInstance(); // initializes the animationPlayer 186 188 } 187 189 … … 374 376 testText->setBindNode(tn); 375 377 376 t estAnim = new tAnim<Text>(testText, &Text::setBlending);378 tAnim<Text>* testAnim = new tAnim<Text>(testText, &Text::setBlending); 377 379 testAnim->addKeyFrame(0.0, 1.0, ANIM_LINEAR); 378 380 testAnim->addKeyFrame(1.0, 1.0, ANIM_LINEAR); … … 944 946 this->garbageCollector->tick(seconds); 945 947 this->simpleAnimation->tick(seconds); 946 948 AnimationPlayer::getInstance()->tick(seconds); 947 949 //testAnim->tick(seconds); 948 950 … … 1055 1057 else if( !strcmp( cmd->cmd, "view4")) this->localCamera->setViewMode(VIEW_RIGHT); 1056 1058 else if( !strcmp( cmd->cmd, "view5")) this->localCamera->setViewMode(VIEW_TOP); 1057 if (!strcmp(cmd->cmd, "view0")) testAnim->play();1058 if (!strcmp(cmd->cmd, "view1")) testAnim->stop();1059 if (!strcmp(cmd->cmd, "view2")) testAnim->pause();1060 if (!strcmp(cmd->cmd, "view3")) testAnim->replay();1061 if (!strcmp(cmd->cmd, "view4")) testAnim->rewind();1062 1059 1063 1060 return false; -
orxonox/trunk/src/story_entities/world.h
r3803 r3812 25 25 class GarbageCollector; 26 26 class SimpleAnimation; 27 template<class T> class tAnim;28 27 class Text; 29 28 … … 100 99 GLMenuImageScreen* glmis; //!< The Level-Loader Display 101 100 102 tAnim<Text>* testAnim;103 101 Text* testText; //!< A text to Test the TextEngine; 104 102
Note: See TracChangeset
for help on using the changeset viewer.