Changeset 590
- Timestamp:
- Dec 17, 2007, 8:23:26 PM (17 years ago)
- Location:
- code/branches/FICN
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/bin/levels/sample.oxw
r588 r590 9 9 <bar top="200" left="50" width="300" height="20" image="textures/load_screens/ambush-loadbar.png" /> 10 10 </loading> 11 11 12 12 13 <!-- <audio> … … 39 40 40 41 <SceneNode name="node1" pos="0,2000,0" scale="40,40,40" /> 41 < Entity name="asteroid1" src="ast1.mesh" node="node1" />42 <BaseEntity name="asteroid1" src="ast1.mesh" node="node1" /> 42 43 43 44 <SceneNode name="node2" pos="2000,0,0" scale="20,20,20"/> 44 <Entity name="asteroid2" src="ast2.mesh" node="node2" /> 45 <BaseEntity name="asteroid2" src="ast2.mesh" node="node2" /> 46 45 47 46 48 <SceneNode name="node3" pos="0,0,2000" scale="20,20,20"/> 47 < Entity name="aststeroid3" src="ast3.mesh" node="node3"/>49 <BaseEntity name="aststeroid3" src="ast3.mesh" node="node3"/> 48 50 49 51 <SceneNode name="node4" pos="0,-2000,0" scale="20,20,20"/> 50 < Entity name="asteroid4" src="ast4.mesh" node="node4" />52 <BaseEntity name="asteroid4" src="ast4.mesh" node="node4" /> 51 53 52 54 <SceneNode name="node5" pos="-2000,0,0" scale="20,20,20"/> 53 < Entity name="asteroid5" src="ast5.mesh" node="node5" />55 <BaseEntity name="asteroid5" src="ast5.mesh" node="node5" /> 54 56 55 57 <SceneNode name="node6" pos="0,0,-2000" scale="20,20,20"/> 56 < Entity name="asteroid6" src="ast6.mesh" node="node6" />58 <BaseEntity name="asteroid6" src="ast6.mesh" node="node6" /> 57 59 58 60 <SceneNode name="node7" pos="1000,1500,0" scale="50,50,50" /> 59 61 <Entity name="asteroid7" src="ast1.mesh" node="node7" /> 62 60 63 61 64 -
code/branches/FICN/src/network/GameStateManager.cc
r573 r590 82 82 //the size of the gamestate 83 83 int totalsize=0; 84 int memsize=1000; 84 85 //the size of one specific synchronisable 85 86 int tempsize=0; … … 93 94 // reserve a little memory and increase it later on 94 95 COUT(2) << "mallocing" << std::endl; 95 retval->data = (unsigned char*)malloc( 1);96 retval->data = (unsigned char*)malloc(memsize); 96 97 COUT(2) << "malloced" << std::endl; 97 98 … … 106 107 totalsize+=tempsize+3*sizeof(int); 107 108 // allocate additional space 108 retval->data = (unsigned char *)realloc((void *)retval->data, totalsize); 109 if(totalsize+tempsize>memsize){ 110 retval->data = (unsigned char *)realloc((void *)retval->data, totalsize+1000); 111 memsize+=1000; 112 } 109 113 110 114 // run Synchronisable::getData with offset and additional place for 3 ints in between (for ids and length) -
code/branches/FICN/src/orxonox/objects/BaseEntity.cc
r580 r590 30 30 name_ = xmlElem->Attribute("name"); 31 31 mesh_ = xmlElem->Attribute("src"); 32 std::string node= xmlElem->Attribute("node");32 node_ = xmlElem->Attribute("node"); 33 33 34 // get the node35 this->setNode(Orxonox::getSingleton()->getSceneManager()->getSceneNode(node));36 37 38 34 // register variables to be synchronised 39 35 registerAllVariables(); … … 41 37 create(); 42 38 43 std::cout << "Loader: Created entity "<< name_ <<" with source " << mesh_ << " at node " << node << std::endl << std::endl;39 std::cout << "Loader: Created entity "<< name_ <<" with source " << mesh_ << " at node " << node_ << std::endl << std::endl; 44 40 } 45 41 } … … 49 45 registerVar(&name_, name_.length()+1, network::STRING); 50 46 registerVar(&mesh_, mesh_.length()+1, network::STRING); 47 registerVar(&node_, node_.length()+1, network::STRING); 51 48 } 52 49 … … 54 51 if(!valid) 55 52 return false; 53 // get the node 54 this->setNode(Orxonox::getSingleton()->getSceneManager()->getSceneNode(node_)); 56 55 Ogre::SceneManager* mgr = orxonox::Orxonox::getSingleton()->getSceneManager(); 57 56 -
code/branches/FICN/src/orxonox/objects/BaseEntity.h
r568 r590 22 22 std::string name_; 23 23 std::string mesh_; 24 std::string node_; 24 25 // other membervariables 25 Ogre::SceneNode *sceneNode_;26 //Ogre::SceneNode *sceneNode_; 26 27 bool valid; 27 28 }; -
code/branches/FICN/src/orxonox/objects/SceneNode.cc
r580 r590 77 77 } 78 78 } 79 80 void SceneNode::registerAllVariables(){ 81 82 } 83 84 bool SceneNode::create(){ 85 return true; 86 } 87 79 88 } -
code/branches/FICN/src/orxonox/objects/SceneNode.h
r515 r590 4 4 #include "BaseObject.h" 5 5 #include "../../tinyxml/tinyxml.h" 6 #include "network/Synchronisable.h" 6 7 7 8 namespace orxonox 8 9 { 9 class SceneNode : public BaseObject 10 class SceneNode : public BaseObject, public network::Synchronisable 10 11 { 11 12 public: 12 13 13 SceneNode(); 14 virtual ~SceneNode(); 14 15 15 16 16 void loadParams(TiXmlElement* xmlElem); 17 17 void loadParams(TiXmlElement* xmlElem); 18 bool create(); 19 protected: 20 void registerAllVariables(); 18 21 private: 19 22 float x_, y_, z_; 23 float sx_, sy_, sz_; 24 float yaw_, pitch_, roll_; 25 std::string node_; 20 26 21 27 };
Note: See TracChangeset
for help on using the changeset viewer.