Changeset 198
- Timestamp:
- Nov 13, 2007, 9:25:37 PM (17 years ago)
- Location:
- code/branches/main_reto_vs05
- Files:
-
- 4 added
- 2 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/main_reto_vs05/bin/Debug
- Property svn:ignore
-
old new 15 15 Plugin_CgProgramManager_d.dll 16 16 Plugin_OctreeSceneManager_d.dll 17 Ogre.log 18 weapon_framework.exe
-
- Property svn:ignore
-
code/branches/main_reto_vs05/bin/Debug/ogre.cfg
r157 r198 3 3 [Direct3D9 Rendering Subsystem] 4 4 Allow NVPerfHUD=No 5 Anti aliasing=Level 45 Anti aliasing=Level 2 6 6 Floating-point mode=Fastest 7 7 Full Screen=No -
code/branches/main_reto_vs05/bin/Release
- Property svn:ignore
-
old new 14 14 RenderSystem_Direct3D9.dll 15 15 RenderSystem_GL.dll 16 Ogre.log 17 weapon_framework.exe
-
- Property svn:ignore
-
code/branches/main_reto_vs05/scripts/weapon_framework.vcproj
r195 r198 41 41 Name="VCCLCompilerTool" 42 42 Optimization="0" 43 AdditionalIncludeDirectories="..\src; ..\src\weapon;"$(OGRE_HOME)\OgreMain\include";"$(OGRE_HOME)\Dependencies\include""43 AdditionalIncludeDirectories="..\src;"$(OGRE_HOME)\OgreMain\include";"$(OGRE_HOME)\Dependencies\include"" 44 44 PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" 45 45 MinimalRebuild="true" … … 120 120 <Tool 121 121 Name="VCCLCompilerTool" 122 AdditionalIncludeDirectories="..\src; ..\src\weapon;"$(OGRE_HOME)\OgreMain\include";"$(OGRE_HOME)\Dependencies\include""122 AdditionalIncludeDirectories="..\src;"$(OGRE_HOME)\OgreMain\include";"$(OGRE_HOME)\Dependencies\include"" 123 123 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS" 124 124 RuntimeLibrary="2" … … 223 223 </File> 224 224 <File 225 RelativePath="..\src\weapon\base_weapon.cpp" 226 > 227 </File> 228 <File 225 229 RelativePath="..\src\weapon\bullet.cc" 226 230 > … … 231 235 </File> 232 236 <File 233 RelativePath="..\src\weapon\weapon_ manager.cc"237 RelativePath="..\src\weapon\weapon_station.cc" 234 238 > 235 239 </File> … … 281 285 </File> 282 286 <File 287 RelativePath="..\src\weapon\base_weapon.h" 288 > 289 </File> 290 <File 283 291 RelativePath="..\src\weapon\bullet.h" 284 292 > … … 293 301 </File> 294 302 <File 295 RelativePath="..\src\weapon\weapon_ manager.h"303 RelativePath="..\src\weapon\weapon_station.h" 296 304 > 297 305 </File> -
code/branches/main_reto_vs05/src/orxonox_prerequisites.h
r189 r198 46 46 class Bullet; 47 47 class BulletManager; 48 class Weapon;49 class Weapon Manager;48 class BaseWeapon; 49 class WeaponStation; 50 50 51 51 } -
code/branches/main_reto_vs05/src/orxonox_scene.cc
r169 r198 98 98 void OrxonoxScene::createScene() 99 99 { 100 sceneMgr_->setAmbientLight(ColourValue(0.3,0.3,0.3) );100 sceneMgr_->setAmbientLight(ColourValue(0.3,0.3,0.3)*2); 101 101 102 102 //create first entity … … 110 110 111 111 // set up skybox 112 sceneMgr_->setSkyBox(true, "Examples/SceneSkyBox 2");112 sceneMgr_->setSkyBox(true, "Examples/SceneSkyBox1"); 113 113 114 114 // set up one light_ source -
code/branches/main_reto_vs05/src/orxonox_ship.cc
r194 r198 36 36 #include "weapon/bullet.h" 37 37 #include "weapon/bullet_manager.h" 38 #include "weapon/weapon_manager.h" 38 #include "weapon/weapon_station.h" 39 #include "weapon/base_weapon.h" 40 #include "weapon/ammunition_dump.h" 39 41 40 42 #include "orxonox_ship.h" … … 68 70 OrxonoxShip::OrxonoxShip(SceneManager *sceneMgr, SceneNode *node, 69 71 BulletManager *bulletManager) 70 : sceneMgr_(sceneMgr), //currentSpeed_(Vector3(0, 0, 0)),72 : sceneMgr_(sceneMgr), 71 73 baseThrust_(1000), currentThrust_(Vector3::ZERO), 72 objectCounter_(0), bulletManager_(bulletManager) //, bulletSpeed_(400)74 objectCounter_(0), bulletManager_(bulletManager) 73 75 { 74 76 rootNode_ = new InertialNode(node, Vector3::ZERO); … … 84 86 if (mainWeapon_) 85 87 delete mainWeapon_; 88 if (railGunStation_) 89 delete railGunStation_; 86 90 if (rootNode_) 87 91 delete rootNode_; … … 111 115 112 116 // initialise weapon(s) 117 ammoDump_ = new AmmunitionDump(420); 118 ammoDump_->store(420); 119 113 120 InertialNode *mainWeaponNode = rootNode_->createChildNode(); 114 mainWeapon_ = new WeaponManager(sceneMgr_, mainWeaponNode, 115 bulletManager_, 1); 116 mainWeapon_->addWeapon("Barrel Gun"); 121 mainWeapon_ = new BaseWeapon(sceneMgr_, mainWeaponNode, 122 bulletManager_, ammoDump_); 123 124 railGunStation_ = new WeaponStation(4); 125 railGunStation_->addWeapon(mainWeapon_); 126 railGunStation_->selectWeapon(0); 117 127 118 128 return true; … … 198 208 * @return Bullet containing speed and entity. 199 209 */ 200 WeaponManager* OrxonoxShip::getMainWeapon()210 BaseWeapon* OrxonoxShip::getMainWeapon() 201 211 { 202 212 return mainWeapon_; 213 } 214 215 216 int OrxonoxShip::getAmmoStock() 217 { 218 return ammoDump_->getStockSize(); 203 219 } 204 220 -
code/branches/main_reto_vs05/src/orxonox_ship.h
r194 r198 54 54 Ogre::Vector3 getSpeed(); 55 55 56 weapon::WeaponManager* getMainWeapon(); 56 weapon::BaseWeapon* getMainWeapon(); 57 58 int getAmmoStock(); 57 59 58 60 bool tick(unsigned long, Ogre::Real); … … 74 76 //Ogre::Vector3 bulletSpeed_; 75 77 76 weapon::WeaponManager *mainWeapon_; 78 weapon::BaseWeapon *mainWeapon_; 79 weapon::WeaponStation *railGunStation_; 80 81 weapon::AmmunitionDump *ammoDump_; 77 82 }; 78 83 -
code/branches/main_reto_vs05/src/run_manager.cc
r194 r198 56 56 #include "weapon/bullet.h" 57 57 #include "weapon/bullet_manager.h" 58 #include "weapon/ weapon_manager.h"58 #include "weapon/base_weapon.h" 59 59 60 60 #include "run_manager.h" … … 108 108 // create a bullet manager 109 109 bulletManager_ = new BulletManager(sceneMgr_); 110 WeaponManager::loadWeapons();111 110 112 111 … … 213 212 if (bulletManager_) 214 213 delete bulletManager_; 215 216 WeaponManager::destroyWeapons();217 214 } 218 215 … … 352 349 353 350 if (keyboard_->isKeyDown(KC_G)) 354 playerShip_->getMainWeapon()->addAction( WeaponManager::RELOAD);351 playerShip_->getMainWeapon()->addAction(BaseWeapon::RELOAD); 355 352 356 353 if( keyboard_->isKeyDown(KC_ESCAPE) || keyboard_->isKeyDown(KC_Q) ) … … 421 418 if(displayCameraDetails) 422 419 debugText_ = " | Speed = " 423 + StringConverter::toString(playerShip_->getSpeed()); 420 + StringConverter::toString(playerShip_->getSpeed()) 421 + " | Left Ammo = " 422 + StringConverter::toString(playerShip_ 423 ->getMainWeapon()->getAmmoState()) 424 + " | Ammo stock = " 425 + StringConverter::toString(playerShip_->getAmmoStock()); 424 426 // debugText_ = "P: " + StringConverter::toString(camera_ 425 427 // ->getDerivedPosition()) + " " + "O: " -
code/branches/main_reto_vs05/src/weapon/ammunition_dump.cc
r189 r198 32 32 namespace weapon { 33 33 34 AmmunitionDump::AmmunitionDump() 34 AmmunitionDump::AmmunitionDump(int capacity) 35 : stock_(0), capacity_(capacity) 35 36 { 36 37 } … … 41 42 } 42 43 44 45 void AmmunitionDump::store(int quantity) 46 { 47 stock_ += quantity; 48 if (stock_ > capacity_) 49 stock_ = capacity_; 50 } 51 52 53 int AmmunitionDump::getAmmunition(int quantity) 54 { 55 if (stock_ >= quantity) 56 { 57 stock_ -= quantity; 58 return quantity; 59 } 60 else 61 { 62 quantity = stock_; 63 stock_ = 0; 64 return quantity; 65 } 66 } 67 68 69 int AmmunitionDump::getStockSize() 70 { 71 return stock_; 72 } 43 73 } 44 74 } -
code/branches/main_reto_vs05/src/weapon/ammunition_dump.h
r189 r198 41 41 { 42 42 public: 43 AmmunitionDump( );43 AmmunitionDump(int capacity); 44 44 ~AmmunitionDump(); 45 45 46 void store(int quantiy); 47 48 int getAmmunition(int quantity); 49 50 int getStockSize(); 51 46 52 protected: 53 int stock_; 54 int capacity_; 47 55 48 56 protected: -
code/branches/main_reto_vs05/src/weapon/weapon.h
r189 r198 26 26 */ 27 27 28 #if 0 28 29 29 30 #ifndef WEAPON_H … … 42 43 public: 43 44 Weapon(const Ogre::String &name, int firePower, int firingRate, 44 Ogre::Real bulletSpeed )45 Ogre::Real bulletSpeed, int magazineSize) 45 46 : name_(name), firePower_(firePower), firingRate_(firingRate), 46 bulletSpeed_(bulletSpeed) { }47 bulletSpeed_(bulletSpeed), magazineSize_(magazineSize) { } 47 48 48 49 virtual ~Weapon() { } … … 53 54 int firingRate_; 54 55 Ogre::Real bulletSpeed_; 56 int magazineSize_; 55 57 }; 56 58 … … 59 61 60 62 #endif /* WEAPON_H */ 63 64 #endif
Note: See TracChangeset
for help on using the changeset viewer.