- Timestamp:
- Jul 18, 2005, 3:26:03 PM (19 years ago)
- Location:
- orxonox/branches/weaponSystem/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/weaponSystem/src/lib/sound/sound_engine.cc
r4883 r4884 138 138 alSourcei (this->sourceID, AL_BUFFER, buffer->getID()); 139 139 alSourcePlay(this->sourceID); 140 // printf("playing sound\n"); 140 141 if (unlikely(this->buffer != NULL)) 142 alSourcei (this->sourceID, AL_BUFFER, this->buffer->getID()); 141 143 } 142 144 -
orxonox/branches/weaponSystem/src/world_entities/weapons/test_gun.cc
r4883 r4884 153 153 { 154 154 this->energyLoaded -= this->minCharge; 155 if (this->soundBuffers[WA_SHOOT] != NULL)156 this->soundSource->play(this->soundBuffers[WA_SHOOT]);157 158 159 155 Projectile* pj = new TestBullet(this);//dynamic_cast<Projectile*>(ObjectManager::getInstance()->getFromDeadList(CL_TEST_BULLET & CL_MASK_LOWLEVEL_CLASS)); 160 156 // weaponSource->play(); -
orxonox/branches/weaponSystem/src/world_entities/weapons/weapon.cc
r4883 r4884 91 91 if (action >= WA_ACTION_COUNT) 92 92 return; 93 else 93 else if (soundFile != NULL) 94 94 { 95 95 this->soundBuffers[action] = (SoundBuffer*)ResourceManager::getInstance()->load(soundFile, WAV); … … 102 102 PRINTF(4)("failed to load sound %s to %s\n", soundFile, actionToChar(action)); 103 103 } 104 105 } 104 } 105 else 106 this->soundBuffers[action] = NULL; 106 107 } 107 108 … … 136 137 //if (likely(this->currentState != WS_INACTIVE)) 137 138 { 138 if (this->minCharge < this->energyLoaded)139 if (this->minCharge <= this->energyLoaded) 139 140 { 141 if (this->soundBuffers[WA_SHOOT] != NULL) 142 this->soundSource->play(this->soundBuffers[WA_SHOOT]); 140 143 this->fire(); 141 144 this->requestedAction = WA_NONE; … … 151 154 if ( this->currentState != WS_INACTIVE && this->energyLoaded >= this->minCharge) 152 155 { 156 if (this->soundBuffers[WA_CHARGE] != NULL) 157 this->soundSource->play(this->soundBuffers[WA_CHARGE]); 153 158 this->charge(); 154 159 this->requestedAction = WA_NONE; … … 163 168 //if (this->currentState != WS_INACTIVE && this->energy + this->energyLoaded >= this->minCharge) 164 169 { 170 if (this->soundBuffers[WA_RELOAD] != NULL) 171 this->soundSource->play(this->soundBuffers[WA_RELOAD]); 172 165 173 this->reload(); 166 174 this->requestedAction = WA_NONE; … … 170 178 if (this->currentState != WS_INACTIVE) 171 179 { 180 if (this->soundBuffers[WA_DEACTIVATE] != NULL) 181 this->soundSource->play(this->soundBuffers[WA_DEACTIVATE]); 182 172 183 this->deactivate(); 173 184 this->requestedAction = WA_NONE; … … 177 188 if (this->currentState == WS_INACTIVE) 178 189 { 190 if (this->soundBuffers[WA_ACTIVATE] != NULL) 191 this->soundSource->play(this->soundBuffers[WA_ACTIVATE]); 192 179 193 this->activate(); 180 194 this->requestedAction = WA_NONE; -
orxonox/branches/weaponSystem/src/world_entities/weapons/weapon.h
r4883 r4884 147 147 // PHASES // 148 148 //////////// 149 private: 149 150 WeaponState currentState; //!< The State the weapon is in. 150 151 WeaponAction requestedAction; //!< An action to try to Engage after the currentState ends. … … 157 158 bool hideInactive; //!< Hides the Weapon if it is inactive 158 159 159 private:160 160 bool active; //!< states wheter the weapon is enabled or not 161 161 Projectile* projectile; //!< the projectile used for this weapon
Note: See TracChangeset
for help on using the changeset viewer.