- Timestamp:
- Jan 17, 2006, 11:13:05 PM (19 years ago)
- Location:
- trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/lang/base_object.cc
r6498 r6517 32 32 * @param root the element to load from 33 33 */ 34 BaseObject::BaseObject( const TiXmlElement* root)34 BaseObject::BaseObject() 35 35 { 36 36 this->className = "BaseObject"; … … 39 39 this->objectName = NULL; 40 40 this->classList = NULL; 41 42 if (root) 43 this->loadParams(root); 41 this->xmlElem = NULL; 44 42 45 43 // ClassList::addToClassList(this, this->classID, "BaseObject"); … … 56 54 if (this->objectName) 57 55 delete[] this->objectName; 56 if (this->xmlElem != NULL) 57 delete this->xmlElem; 58 58 } 59 59 … … 64 64 void BaseObject::loadParams(const TiXmlElement* root) 65 65 { 66 // all loadParams should sometime arrive here. 67 assert (root != NULL); 68 69 if (this->xmlElem != NULL) 70 delete this->xmlElem; 71 this->xmlElem = root->Clone(); 66 72 // name setup 67 73 LoadParam(root, "name", this, BaseObject, setName) -
trunk/src/lib/lang/base_object.h
r6512 r6517 18 18 #include "stdincl.h" 19 19 20 class TiXmlNode; 20 21 class TiXmlElement; 21 22 class ClassList; … … 25 26 26 27 public: 27 BaseObject ( const TiXmlElement* root = NULL);28 BaseObject (); 28 29 virtual ~BaseObject (); 29 30 … … 49 50 int writeState(const byte* data, int length, int sender); 50 51 int readState(byte* data, int maxLength ); 52 51 53 protected: 52 54 void setClassID(ClassID classID, const char* className); 53 55 54 56 private: 55 57 const char* className; //!< the name of the class 56 58 long classID; //!< this is the id from the class_id.h enumeration … … 58 60 59 61 ClassList* classList; //!< Pointer to the ClassList this Object is inside of 62 63 TiXmlNode* xmlElem; //!< The XML Element with wich this Object was loaded(saved). 60 64 }; 61 65 -
trunk/src/world_entities/space_ships/space_ship.cc
r6512 r6517 123 123 PRINTF(4)("SPACESHIP INIT\n"); 124 124 125 EventHandler::getInstance()->grabEvents(true);125 // EventHandler::getInstance()->grabEvents(true); 126 126 127 127 bUp = bDown = bLeft = bRight = bAscend = bDescend = bRollL = bRollR = false; -
trunk/src/world_entities/weapons/cannon.cc
r6512 r6517 55 55 { 56 56 this->init(); 57 this->loadParams(root); 57 if (root != NULL) 58 this->loadParams(root); 58 59 } 59 60
Note: See TracChangeset
for help on using the changeset viewer.