- Timestamp:
- Jan 8, 2006, 10:45:03 PM (19 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/playable.cc
r6443 r6444 52 52 53 53 if (this->currentPlayer != NULL) 54 54 this->currentPlayer->weaponConfigChanged(); 55 55 } 56 56 … … 59 59 this->weaponMan->removeWeapon(weapon); 60 60 61 if (this->currentPlayer != NULL) 62 this->currentPlayer->weaponConfigChanged(); 63 } 64 65 void Playable::nextWeaponConfig() 66 { 67 this->weaponMan->nextWeaponConfig(); 68 if (this->currentPlayer != NULL) 69 this->currentPlayer->weaponConfigChanged(); 70 } 71 72 void Playable::previousWeaponConfig() 73 { 74 this->weaponMan->previousWeaponConfig(); 61 75 if (this->currentPlayer != NULL) 62 76 this->currentPlayer->weaponConfigChanged(); … … 154 168 void Playable::attachCamera() 155 169 { 156 157 170 State::getCamera()->setParentSoft(this); 171 State::getCameraTarget()->setParentSoft(this); 158 172 159 173 } … … 162 176 void Playable::detachCamera() 163 177 { 164 165 166 178 } -
trunk/src/world_entities/playable.h
r6443 r6444 11 11 #include <list> 12 12 13 #include "world_entities/weapons/weapon_manager.h" 13 14 14 15 class Weapon; 15 class WeaponManager; 16 16 17 class Player; 17 18 … … 31 32 void addWeapon(Weapon* weapon, int configID = -1, int slotID = -1); 32 33 void removeWeapon(Weapon* weapon); 34 void nextWeaponConfig(); 35 void previousWeaponConfig(); 33 36 34 37 inline WeaponManager* getWeaponManager() const { return this->weaponMan; }; -
trunk/src/world_entities/space_ships/space_ship.cc
r6443 r6444 434 434 else if( event.type == KeyMapper::PEV_NEXT_WEAPON && event.bPressed) 435 435 { 436 this-> getWeaponManager()->nextWeaponConfig();//if( !event.bPressed) this->bWeaponChange = !this->bWeaponChange;436 this->nextWeaponConfig();//if( !event.bPressed) this->bWeaponChange = !this->bWeaponChange; 437 437 } 438 438 else if ( event.type == KeyMapper::PEV_PREVIOUS_WEAPON && event.bPressed) 439 this-> getWeaponManager()->previousWeaponConfig();439 this->previousWeaponConfig(); 440 440 else if( event.type == SDLK_w) 441 441 this->bUp = event.bPressed; //this->shiftCoor(0,.1,0); -
trunk/src/world_entities/weapons/weapon.cc
r6439 r6444 421 421 if (likely(this->soundBuffers[WA_ACTIVATE] != NULL)) 422 422 this->soundSource->play(this->soundBuffers[WA_ACTIVATE]); 423 this->updateWidgets(); 423 424 // activate 424 425 PRINTF(4)("Activating the Weapon %s\n", this->getName()); … … 482 483 if (this->soundBuffers[WA_SHOOT] != NULL) 483 484 this->soundSource->play(this->soundBuffers[WA_SHOOT]); 485 this->updateWidgets(); 484 486 // fire 485 487 this->energyLoaded -= this->minCharge; … … 526 528 this->energy -= chargeSize; 527 529 } 530 531 this->updateWidgets(); 528 532 this->reload(); 529 533 this->enterState(WS_RELOADING); -
trunk/src/world_entities/weapons/weapon_manager.h
r6442 r6444 9 9 * @TODO 1. WeaponManager should also handle a List of availiableWeapons. 10 10 */ 11 12 #ifndef _WEAPON_MANAGER_H 13 #define _WEAPON_MANAGER_H 11 14 12 15 #include "base_object.h" … … 70 73 void addWeapon(Weapon* weapon, int configID = -1, int slotID = -1); 71 74 void removeWeapon(Weapon* weapon, int configID = -1); 72 Weapon* getWeapon(int slotID) const { return (slotID >= 0 && slotID < this->slotCount)? this->currentSlotConfig[slotID]. currentWeapon: NULL; };75 Weapon* getWeapon(int slotID) const { return (slotID >= 0 && slotID < this->slotCount)? this->currentSlotConfig[slotID].nextWeapon: NULL; }; 73 76 74 77 // FIXME :: … … 109 112 tAnimation<Crosshair>* crossHairSizeAnim; //!< An animation for the crosshair (scaling) 110 113 }; 114 115 116 #endif /* _WEAPON_MANAGER_H */
Note: See TracChangeset
for help on using the changeset viewer.