Changeset 10678 in orxonox.OLD for branches/vs-enhencements
- Timestamp:
- Jun 7, 2007, 5:59:39 PM (18 years ago)
- Location:
- branches/vs-enhencements/src
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/vs-enhencements/src/lib/collision_reaction/cr_defs.h
r10013 r10678 25 25 26 26 //!< the maximal number of bounding volumes collision events per frame 27 #define CR_MAX_COLLISION_EVENTS 300027 #define CR_MAX_COLLISION_EVENTS 5000 28 28 29 29 -
branches/vs-enhencements/src/lib/coord/p_node.cc
r9869 r10678 143 143 void PNode::loadParams(const TiXmlElement* root) 144 144 { 145 if (!root) 146 return; 147 145 148 BaseObject::loadParams(root); 146 149 -
branches/vs-enhencements/src/world_entities/npcs/npc.cc
r10648 r10678 417 417 } 418 418 419 420 421 419 this->weaponMan.tick(dt); 422 420 if (this->bFire) -
branches/vs-enhencements/src/world_entities/playable.cc
r10618 r10678 93 93 void Playable::loadParams(const TiXmlElement* root) 94 94 { 95 if (!root) 96 return; 95 97 WorldEntity::loadParams(root); 96 98 -
branches/vs-enhencements/src/world_entities/space_ships/space_ship.cc
r10675 r10678 165 165 this->secWeaponMan.setSlotCount(6); 166 166 167 this->weaponMan.createWeaponSlot(0, 3.270, 1.028, .155, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);168 this->weaponMan.createWeaponSlot(1, 3.270, 1.028, -.155, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);169 this->weaponMan.createWeaponSlot(2, 4.385, .063, .876, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);170 this->weaponMan.createWeaponSlot(3, 4.385, -.063, -.876, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);171 this->weaponMan.createWeaponSlot(4, 1.635, -.612, 2.691, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);172 this->weaponMan.createWeaponSlot(5, 1.536, -.612, -2.691, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);173 this->weaponMan.createWeaponSlot(6, 1.536, -.612, 3.254, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);174 this->weaponMan.createWeaponSlot(7, 1.536, -.612, -3.254, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);175 176 177 this->weaponMan.addWeaponToSlot(0, 0, "RFCannon");178 this->weaponMan.addWeaponToSlot(0, 1, "RFCannon");179 this->weaponMan.addWeaponToSlot(0, 2, "RFCannon");180 this->weaponMan.addWeaponToSlot(0, 3, "RFCannon");181 this->weaponMan.addWeaponToSlot(1, 0, "RFCannon");182 this->weaponMan.addWeaponToSlot(1, 1, "RFCannon");183 this->weaponMan.addWeaponToSlot(1, 2, "RFCannon");184 this->weaponMan.addWeaponToSlot(1, 3, "RFCannon");167 // this->weaponMan.createWeaponSlot(0, 3.270, 1.028, .155, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 168 // this->weaponMan.createWeaponSlot(1, 3.270, 1.028, -.155, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 169 // this->weaponMan.createWeaponSlot(2, 4.385, .063, .876, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 170 // this->weaponMan.createWeaponSlot(3, 4.385, -.063, -.876, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 171 // this->weaponMan.createWeaponSlot(4, 1.635, -.612, 2.691, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 172 // this->weaponMan.createWeaponSlot(5, 1.536, -.612, -2.691, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 173 // this->weaponMan.createWeaponSlot(6, 1.536, -.612, 3.254, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 174 // this->weaponMan.createWeaponSlot(7, 1.536, -.612, -3.254, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL); 175 176 177 // this->weaponMan.addWeaponToSlot(0, 0, "RFCannon"); 178 // this->weaponMan.addWeaponToSlot(0, 1, "RFCannon"); 179 // this->weaponMan.addWeaponToSlot(0, 2, "RFCannon"); 180 // this->weaponMan.addWeaponToSlot(0, 3, "RFCannon"); 181 // this->weaponMan.addWeaponToSlot(1, 0, "RFCannon"); 182 // this->weaponMan.addWeaponToSlot(1, 1, "RFCannon"); 183 // this->weaponMan.addWeaponToSlot(1, 2, "RFCannon"); 184 // this->weaponMan.addWeaponToSlot(1, 3, "RFCannon"); 185 185 186 186 this->weaponMan.addWeaponToSlot(0, 4, "NadionLaser"); … … 452 452 { 453 453 454 //if( !this->bInit)455 //{456 //// now get slots from the mount points457 //std::map<int, MountPoint*>::iterator it = this->mountPointMap.begin();458 //for( ;it != this->mountPointMap.end(); it++)459 //{460 //WeaponSlot* ws = dynamic_cast<WeaponSlot*>((*it).second->getMount());461 //if( ws != NULL && ws->isA(WeaponSlot::staticClassID()))462 //{463 //int slot = ws->getWeaponSlot();464 // //int side = ws->getWeaponSide(); //FIXME / REMOVE: is not used// HACK needed for some weapons (left/right)465 //this->getWeaponManager().setSlotPosition(slot, (*it).second->getCenter());466 //this->getWeaponManager().setSlotDirection(slot, ws->getRelDir());467 // //PRINTF(0)("setting slot %i\n", slot);468 // //(*it).second->getCenter().debug();469 //}470 //}471 //this->bInit = true;472 //}454 if( !this->bInit) 455 { 456 // now get slots from the mount points 457 std::map<int, MountPoint*>::iterator it = this->mountPointMap.begin(); 458 for( ;it != this->mountPointMap.end(); it++) 459 { 460 WeaponSlot* ws = dynamic_cast<WeaponSlot*>((*it).second->getMount()); 461 if( ws != NULL && ws->isA(WeaponSlot::staticClassID())) 462 { 463 int slot = ws->getWeaponSlot(); 464 // int side = ws->getWeaponSide(); //FIXME / REMOVE: is not used// HACK needed for some weapons (left/right) 465 this->getWeaponManager().setSlotPosition(slot, (*it).second->getCenter()); 466 this->getWeaponManager().setSlotDirection(slot, ws->getRelDir()); 467 // PRINTF(0)("setting slot %i\n", slot); 468 // (*it).second->getCenter().debug(); 469 } 470 } 471 this->bInit = true; 472 } 473 473 474 474 // Playable::tick(time); -
branches/vs-enhencements/src/world_entities/weapons/weapon_manager.cc
r10676 r10678 100 100 } 101 101 102 for (int i = 0; i < WM_MAX_LOADED_WEAPONS; i++)103 this->availiableWeapons[i] = NULL;102 // for (int i = 0; i < WM_MAX_LOADED_WEAPONS; i++) 103 // this->availiableWeapons[i] = NULL; 104 104 105 105 … … 287 287 } 288 288 289 // if (configID > 0 && slotID > 0 && this->configs[configID][slotID]!= NULL)290 //{291 //PRINTF(3)("Weapon-slot %d/%d of %s already poulated, remove weapon (%s::%s) first\n", configID, slotID, this->getCName(), weapon->getClassCName(), weapon->getCName());292 //return false;293 //}294 295 //if (slotID <= -1) // WM_FREE_SLOT296 //{297 //slotID = this->getNextFreeSlot(configID, weapon->getCapability());298 //if( slotID < 0 || slotID >= this->slotCount)299 //{300 //PRINTF(1)("There is no free slot in this WeaponConfig to dock this weapon at! Aborting\n");301 //return false;302 //}303 //}304 305 //if (!(this->slotConfigs[slotID]->getCapability() & weapon->getCapability() & WTYPE_ALLKINDS) &&306 //this->slotConfigs[slotID]->getCapability() & weapon->getCapability() & WTYPE_ALLDIRS)307 //{308 //PRINTF(2)("Unable to add Weapon with wrong capatibility to Slot %d (W:%d M:%d)\n",309 //slotID, weapon->getCapability(), this->slotConfigs[slotID]->getCapability());310 //return false;311 //}289 if (configID > 0 && slotID > 0 && this->slotConfigs[slotID]->getWeapon(configID) != NULL) 290 { 291 PRINTF(3)("Weapon-slot %d/%d of %s already poulated, remove weapon (%s::%s) first\n", configID, slotID, this->getCName(), weapon->getClassCName(), weapon->getCName()); 292 return false; 293 } 294 295 if (slotID <= -1) // WM_FREE_SLOT 296 { 297 slotID = this->getNextFreeSlot(configID, weapon->getCapability()); 298 if( slotID < 0 || slotID >= this->slotCount) 299 { 300 PRINTF(1)("There is no free slot in this WeaponConfig to dock this weapon at! Aborting\n"); 301 return false; 302 } 303 } 304 305 if (!(this->slotConfigs[slotID]->getCapability() & weapon->getCapability() & WTYPE_ALLKINDS) && 306 this->slotConfigs[slotID]->getCapability() & weapon->getCapability() & WTYPE_ALLDIRS) 307 { 308 PRINTF(2)("Unable to add Weapon with wrong capatibility to Slot %d (W:%d M:%d)\n", 309 slotID, weapon->getCapability(), this->slotConfigs[slotID]->getCapability()); 310 return false; 311 } 312 312 313 313 //! @todo check if the weapon is already assigned to another config in another slot … … 508 508 { 509 509 tickWeapon->toList(OM_NULL); 510 this->slotConfigs[i]->setCurrentWeapon( NULL);510 this->slotConfigs[i]->setCurrentWeapon(-1); 511 511 } 512 512 } … … 530 530 } 531 531 else if (unlikely(tickWeapon != NULL && tickWeapon->getCurrentState() == WS_DEACTIVATING)) 532 this->slotConfigs[i]->setCurrentWeapon( NULL);532 this->slotConfigs[i]->setCurrentWeapon(-1); 533 533 } 534 534 } -
branches/vs-enhencements/src/world_entities/weapons/weapon_manager.h
r10676 r10678 125 125 // WeaponSlot* currentSlotConfig[WM_MAX_SLOTS]; //!< The currentConfigureation. 126 126 WeaponSlot* slotConfigs[WM_MAX_SLOTS]; 127 Weapon* availiableWeapons[WM_MAX_LOADED_WEAPONS]; //!< The availiable Weapons of this WeaponSlot127 // Weapon* availiableWeapons[WM_MAX_LOADED_WEAPONS]; //!< The availiable Weapons of this WeaponSlot 128 128 129 129 bool weaponChange; -
branches/vs-enhencements/src/world_entities/weapons/weapon_slot.h
r10676 r10678 32 32 33 33 inline Weapon* getCurrentWeapon() { return this->currentWeapon; } 34 inline void setCurrentWeapon(int config) { this->currentWeapon = this->configs[config]; }34 inline void setCurrentWeapon(int config) { config == -1 ? this->currentWeapon = NULL: this->currentWeapon = this->configs[config]; } 35 35 36 36 inline Weapon* getNextWeapon() { return this->nextWeapon; } 37 inline void setNextWeapon(int config) { if (config == -1) this->nextWeapon = NULL; elsethis->nextWeapon = configs[config]; }37 inline void setNextWeapon(int config) { config == -1 ? this->nextWeapon = NULL : this->nextWeapon = configs[config]; } 38 38 39 39 inline void setNextToCurrent() {this->currentWeapon = this->nextWeapon; }; -
branches/vs-enhencements/src/world_entities/world_entity.cc
r10674 r10678 151 151 void WorldEntity::loadParams(const TiXmlElement* root) 152 152 { 153 if (!root) 154 return; 153 155 // Do the PNode loading stuff 154 156 PNode::loadParams(root);
Note: See TracChangeset
for help on using the changeset viewer.