- Timestamp:
- Nov 13, 2005, 2:49:48 PM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 8 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/Makefile.am
r5549 r5556 65 65 world_entities/weapons/rocket.cc \ 66 66 world_entities/weapons/laser.cc \ 67 world_entities/weapons/aim.cc \ 67 68 world_entities/weapons/crosshair.cc \ 68 69 world_entities/power_ups/power_up.cc \ … … 98 99 world_entities/weapons/rocket.h \ 99 100 world_entities/weapons/laser.h \ 101 world_entities/weapons/aim.h \ 100 102 world_entities/weapons/crosshair.h \ 101 103 world_entities/power_ups/power_up.h \ -
trunk/src/Makefile.in
r5549 r5556 66 66 orxonox-test_gun.$(OBJEXT) orxonox-turret.$(OBJEXT) \ 67 67 orxonox-test_bullet.$(OBJEXT) orxonox-rocket.$(OBJEXT) \ 68 orxonox-laser.$(OBJEXT) orxonox-crosshair.$(OBJEXT) \ 69 orxonox-power_up.$(OBJEXT) orxonox-turret_power_up.$(OBJEXT) \ 68 orxonox-laser.$(OBJEXT) orxonox-aim.$(OBJEXT) \ 69 orxonox-crosshair.$(OBJEXT) orxonox-power_up.$(OBJEXT) \ 70 orxonox-turret_power_up.$(OBJEXT) \ 70 71 orxonox-laser_power_up.$(OBJEXT) orxonox-benchmark.$(OBJEXT) 71 72 orxonox_OBJECTS = $(am_orxonox_OBJECTS) … … 259 260 world_entities/weapons/rocket.cc \ 260 261 world_entities/weapons/laser.cc \ 262 world_entities/weapons/aim.cc \ 261 263 world_entities/weapons/crosshair.cc \ 262 264 world_entities/power_ups/power_up.cc \ … … 292 294 world_entities/weapons/rocket.h \ 293 295 world_entities/weapons/laser.h \ 296 world_entities/weapons/aim.h \ 294 297 world_entities/weapons/crosshair.h \ 295 298 world_entities/power_ups/power_up.h \ … … 392 395 -rm -f *.tab.c 393 396 397 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-aim.Po@am__quote@ 394 398 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-benchmark.Po@am__quote@ 395 399 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orxonox-camera.Po@am__quote@ … … 771 775 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 772 776 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-laser.obj `if test -f 'world_entities/weapons/laser.cc'; then $(CYGPATH_W) 'world_entities/weapons/laser.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/weapons/laser.cc'; fi` 777 778 orxonox-aim.o: world_entities/weapons/aim.cc 779 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-aim.o -MD -MP -MF "$(DEPDIR)/orxonox-aim.Tpo" -c -o orxonox-aim.o `test -f 'world_entities/weapons/aim.cc' || echo '$(srcdir)/'`world_entities/weapons/aim.cc; \ 780 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/orxonox-aim.Tpo" "$(DEPDIR)/orxonox-aim.Po"; else rm -f "$(DEPDIR)/orxonox-aim.Tpo"; exit 1; fi 781 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='world_entities/weapons/aim.cc' object='orxonox-aim.o' libtool=no @AMDEPBACKSLASH@ 782 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 783 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-aim.o `test -f 'world_entities/weapons/aim.cc' || echo '$(srcdir)/'`world_entities/weapons/aim.cc 784 785 orxonox-aim.obj: world_entities/weapons/aim.cc 786 @am__fastdepCXX_TRUE@ if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT orxonox-aim.obj -MD -MP -MF "$(DEPDIR)/orxonox-aim.Tpo" -c -o orxonox-aim.obj `if test -f 'world_entities/weapons/aim.cc'; then $(CYGPATH_W) 'world_entities/weapons/aim.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/weapons/aim.cc'; fi`; \ 787 @am__fastdepCXX_TRUE@ then mv -f "$(DEPDIR)/orxonox-aim.Tpo" "$(DEPDIR)/orxonox-aim.Po"; else rm -f "$(DEPDIR)/orxonox-aim.Tpo"; exit 1; fi 788 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='world_entities/weapons/aim.cc' object='orxonox-aim.obj' libtool=no @AMDEPBACKSLASH@ 789 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 790 @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(orxonox_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o orxonox-aim.obj `if test -f 'world_entities/weapons/aim.cc'; then $(CYGPATH_W) 'world_entities/weapons/aim.cc'; else $(CYGPATH_W) '$(srcdir)/world_entities/weapons/aim.cc'; fi` 773 791 774 792 orxonox-crosshair.o: world_entities/weapons/crosshair.cc -
trunk/src/defs/include_paths.am
r5342 r5556 1 1 AM_CXXFLAGS=-I$(MAINSRCDIR) 2 2 AM_CXXFLAGS+=-I$(MAINSRCDIR)/world_entities 3 AM_CXXFLAGS+=-I$(MAINSRCDIR)/world_entities/weapons4 3 AM_CXXFLAGS+=-I$(MAINSRCDIR)/story_entities 5 4 AM_CXXFLAGS+=-I$(MAINSRCDIR)/lib -
trunk/src/story_entities/world.cc
r5447 r5556 61 61 #include "factory.h" 62 62 63 #include " projectile.h"63 #include "weapons/projectile.h" 64 64 #include "event_handler.h" 65 65 -
trunk/src/util/loading/load_param.h
r5549 r5556 36 36 class LoadClassDescription; 37 37 class LoadParamDescription; 38 class MultiType; 38 39 39 40 /************************** … … 45 46 public: 46 47 LoadParamBase* describe(const char* descriptionText); 48 LoadParamBase* defaultValues(unsigned int count, ...); 47 49 48 50 protected: … … 54 56 const char* loadString; //!< The string loaded by this LoadParam 55 57 const void* pointerToParam; //!< A Pointer to a Parameter. 58 59 MultiType* defaultValue; 56 60 }; 57 61 … … 93 97 #define LoadParam0() \ 94 98 LoadParam(const TiXmlElement* root, const char* paramName, T* pt2Object, void(T::*function)(), bool multi = false) \ 95 : LoadParamBase(root, pt2Object, paramName, 0, multi, NULL , "") \99 : LoadParamBase(root, pt2Object, paramName, 0, multi, NULL) \ 96 100 { \ 97 101 if (loadString != NULL && root != NULL) \ -
trunk/src/util/loading/load_param_description.cc
r5549 r5556 15 15 16 16 #include "load_param_description.h" 17 17 18 #include "list.h" 18 19 #include <stdarg.h> -
trunk/src/util/loading/load_param_description.h
r5549 r5556 26 26 // Forward Declaration // 27 27 template<class T> class tList; 28 class MultiType; 28 29 29 30 /************************ … … 49 50 int* types; //!< What kind of parameters does this function take ?? 50 51 char* description; //!< A longer description about this function. 51 char** defaultValues; //!< The 'Default Values'. 52 char** defaultValues; //!< The 'Default Values'. @TODO MAKE THIS A MULTITYPE 52 53 }; 53 54 … … 71 72 private: 72 73 static bool parametersDescription; //!< if parameter-description should be enabled. 73 static tList<LoadClassDescription>* classList; //!< a list, that holds all the loadable classes. (after one instance has been loaded)74 static tList<LoadClassDescription>* classList; //!< a list, that stores all the loadable classes. (after one instance has been loaded) 74 75 char* className; //!< name of the class 76 75 77 tList<LoadParamDescription>* paramList; //!< List of parameters this class knows. 76 78 }; -
trunk/src/world_entities/player.cc
r5500 r5556 23 23 #include "factory.h" 24 24 25 #include "weapon _manager.h"26 #include " test_gun.h"27 #include " turret.h"25 #include "weapons/weapon_manager.h" 26 #include "weapons/test_gun.h" 27 #include "weapons/turret.h" 28 28 29 29 #include "list.h" -
trunk/src/world_entities/weapons/aim.cc
r5554 r5556 16 16 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WEAPON 17 17 18 #include "crosshair.h" 19 #include "event_handler.h" 18 #include "aim.h" 20 19 21 20 #include "load_param.h" … … 31 30 * standart constructor 32 31 */ 33 Crosshair::Crosshair(const TiXmlElement* root)32 Aim::Aim (const TiXmlElement* root) 34 33 { 35 34 this->init(); … … 42 41 43 42 /** 44 * destroys a Crosshair43 * destroys a Aim 45 44 */ 46 Crosshair::~Crosshair()45 Aim::~Aim () 47 46 { 48 47 if (this->material) … … 56 55 57 56 /** 58 * initializes the Crosshair57 * initializes the Aim 59 58 */ 60 void Crosshair::init()59 void Aim::init() 61 60 { 62 this->setClassID(CL_CROSSHAIR, " Crosshair");63 this->setName(" Crosshair");61 this->setClassID(CL_CROSSHAIR, "Aim"); 62 this->setName("Aim"); 64 63 65 64 this->setLayer(E2D_LAYER_TOP); … … 70 69 this->material = new Material; 71 70 72 EventHandler::getInstance()->subscribe(this, ES_GAME, EV_MOUSE_MOTION);73 74 71 // center the mouse on the screen, and also hide the cursors 75 72 SDL_WarpMouse(GraphicsEngine::getInstance()->getResolutionX()/2, GraphicsEngine::getInstance()->getResolutionY()/2); … … 79 76 80 77 81 void Crosshair::loadParams(const TiXmlElement* root)78 void Aim::loadParams(const TiXmlElement* root) 82 79 { 83 80 static_cast<PNode*>(this)->loadParams(root); 84 static_cast<EventListener*>(this)->loadParams(root);85 81 86 LoadParam< Crosshair>(root, "texture", this, &Crosshair::setTexture)87 .describe("the texture-file to load onto the Crosshair");82 LoadParam<Aim>(root, "texture", this, &Aim::setTexture) 83 .describe("the texture-file to load onto the Aim"); 88 84 89 LoadParam< Crosshair>(root, "size", this, &Crosshair::setSize)90 .describe("the size of the Crosshairin Pixels");85 LoadParam<Aim>(root, "size", this, &Aim::setSize) 86 .describe("the size of the Aim in Pixels"); 91 87 92 LoadParam< Crosshair>(root, "rotation-speed", this, &Crosshair::setRotationSpeed)93 .describe("the Speed with which the Crosshairshould rotate");88 LoadParam<Aim>(root, "rotation-speed", this, &Aim::setRotationSpeed) 89 .describe("the Speed with which the Aim should rotate"); 94 90 } 95 91 96 92 97 93 /** 98 * sets the size of the Crosshair.94 * sets the size of the Aim. 99 95 * @param size the size in pixels 100 96 */ 101 void Crosshair::setSize(float size)97 void Aim::setSize(float size) 102 98 { 103 99 this->setSize2D(size/2, size/2); … … 108 104 * @param textureFile The texture-file to load onto the crosshair 109 105 */ 110 void Crosshair::setTexture(const char* textureFile)106 void Aim::setTexture(const char* textureFile) 111 107 { 112 108 this->material->setDiffuseMap(textureFile); … … 114 110 115 111 /** 116 * processes the input 117 * @param event the Event coming as input 118 */ 119 void Crosshair::process(const Event &event) 120 { 121 if (event.type == EV_MOUSE_MOTION) 122 { 123 this->setAbsCoor2D(event.x, event.y); 124 } 125 } 126 127 /** 128 * ticks the Crosshair 112 * ticks the Aim 129 113 * @param dt the time to ticks 130 114 */ 131 void Crosshair::tick(float dt)115 void Aim::tick(float dt) 132 116 { 133 117 // let the crosshair rotate … … 162 146 * draws the crosshair 163 147 */ 164 void Crosshair::draw() const148 void Aim::draw() const 165 149 { 166 150 glPushMatrix(); -
trunk/src/world_entities/weapons/aim.h
r5554 r5556 1 1 /*! 2 * @file crosshair.h 3 * Definition of ... 2 * @file aim.h 3 * Definition of 4 */ 4 5 5 */ 6 7 #ifndef _CROSSHAIR_H 8 #define _CROSSHAIR_H 6 #ifndef _AIM_H 7 #define _AIM_H 9 8 10 9 #include "p_node.h" 11 10 #include "element_2d.h" 12 #include "event_listener.h"13 14 #include "vector.h"15 16 17 11 // FORWARD DECLARATION 18 12 class Model; … … 20 14 class TiXmlElement; 21 15 22 //! A class that enables the23 class Crosshair : public PNode, public Element2D, public EventListener{16 //! An Aim for zooming in on Targets. 17 class Aim : public PNode, public Element2D { 24 18 25 19 public: 26 Crosshair(const TiXmlElement* root = NULL);27 virtual ~ Crosshair();20 Aim(const TiXmlElement* root = NULL); 21 virtual ~Aim(); 28 22 29 23 void init(); … … 35 29 void setRotationSpeed(float rotationSpeed) { this->rotationSpeed = rotationSpeed; }; 36 30 37 virtual void process(const Event &event);38 31 virtual void tick(float dt); 39 32 virtual void draw() const; … … 44 37 }; 45 38 46 #endif /* _ CROSSHAIR_H */39 #endif /* _AIM_H */
Note: See TracChangeset
for help on using the changeset viewer.