Changeset 5689 for code/branches
- Timestamp:
- Aug 29, 2009, 10:04:04 PM (15 years ago)
- Location:
- code/branches/resource2
- Files:
-
- 2 added
- 46 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/resource2/cmake/LibraryConfig.cmake
r5664 r5689 85 85 # Performs the search and sets the variables # 86 86 87 FIND_PACKAGE(OGRE 1.4 EXACTREQUIRED)87 FIND_PACKAGE(OGRE 1.4 REQUIRED) 88 88 FIND_PACKAGE(ENet 1.1 REQUIRED) 89 89 FIND_PACKAGE(Ogg REQUIRED) -
code/branches/resource2/data/particle/Example-Water.particle
r5352 r5689 1 Examples/Water/Rain1 particle_system Examples/Water/Rain 2 2 { 3 3 material Examples/Droplet -
code/branches/resource2/data/particle/Example.particle
r5352 r5689 2 2 3 3 // Exudes greeny particles which float upwards 4 Examples/GreenyNimbus4 particle_system Examples/GreenyNimbus 5 5 { 6 6 material Examples/FlarePointSprite … … 49 49 50 50 // A sparkly purple fountain 51 Examples/PurpleFountain51 particle_system Examples/PurpleFountain 52 52 { 53 53 material Examples/Flare2 … … 89 89 90 90 // A downpour 91 Examples/Rain91 particle_system Examples/Rain 92 92 { 93 93 material Examples/Droplet … … 125 125 126 126 // A jet engine (of sorts) 127 Examples/JetEngine1127 particle_system Examples/JetEngine1 128 128 { 129 129 material Examples/Flare … … 154 154 155 155 } 156 Examples/JetEngine2156 particle_system Examples/JetEngine2 157 157 { 158 158 material Examples/Flare … … 185 185 186 186 // Exudes aureola particles which around the model float upwards 187 Examples/Aureola187 particle_system Examples/Aureola 188 188 { 189 189 material Examples/Aureola … … 247 247 248 248 249 Examples/Swarm249 particle_system Examples/Swarm 250 250 { 251 251 quota 3000 … … 342 342 343 343 344 Examples/Snow344 particle_system Examples/Snow 345 345 { 346 346 quota 2000 -
code/branches/resource2/data/particle/ExplosionComp1.particle
r5539 r5689 1 1 2 Orxonox/ExplosionComp12 particle_system Orxonox/ExplosionComp1 3 3 { 4 4 quota 150 -
code/branches/resource2/data/particle/ExplosionComp2.particle
r5539 r5689 1 1 2 Orxonox/ExplosionComp22 particle_system Orxonox/ExplosionComp2 3 3 { 4 4 quota 1000 -
code/branches/resource2/data/particle/ExplosionComp4.particle
r5539 r5689 1 1 2 ExplosionComp42 particle_system ExplosionComp4 3 3 { 4 4 quota 10 … … 20 20 } 21 21 22 Orxonox/ExplosionComp422 particle_system Orxonox/ExplosionComp4 23 23 { 24 24 quota 500 -
code/branches/resource2/data/particle/FireComp2.particle
r5539 r5689 1 1 2 Orxonox/FireComp22 particle_system Orxonox/FireComp2 3 3 { 4 4 quota 10000 -
code/branches/resource2/data/particle/LaserGun.particle
r5539 r5689 1 1 2 Orxonox/LaserGun2 particle_system Orxonox/LaserGun 3 3 { 4 4 quota 1000 -
code/branches/resource2/data/particle/ThrusterFire.particle
r5372 r5689 1 1 2 Orxonox/ThrusterFire2 particle_system Orxonox/ThrusterFire 3 3 { 4 4 quota 50 -
code/branches/resource2/data/particle/bigexplosion1part1.particle
r5352 r5689 1 1 2 Orxonox/BigExplosion1part12 particle_system Orxonox/BigExplosion1part1 3 3 { 4 4 quota 100 -
code/branches/resource2/data/particle/bigexplosion1part2.particle
r5352 r5689 1 1 2 Orxonox/BigExplosion1part22 particle_system Orxonox/BigExplosion1part2 3 3 { 4 4 quota 50 -
code/branches/resource2/data/particle/bigexplosion1part3.particle
r5352 r5689 1 1 2 Orxonox/BigExplosion1part32 particle_system Orxonox/BigExplosion1part3 3 3 { 4 4 quota 120 -
code/branches/resource2/data/particle/emitted_emitter.particle
r5352 r5689 1 1 // Example emitted emitters 2 Examples/Fireworks2 particle_system Examples/Fireworks 3 3 { 4 4 material Examples/Flare -
code/branches/resource2/data/particle/engineglow.particle
r5352 r5689 1 1 2 Orxonox/engineglow2 particle_system Orxonox/engineglow 3 3 { 4 4 quota 200 -
code/branches/resource2/data/particle/explosion1.particle
r5352 r5689 1 1 2 Orxonox/explosion12 particle_system Orxonox/explosion1 3 3 { 4 4 quota 200 -
code/branches/resource2/data/particle/explosion2.particle
r5352 r5689 1 1 2 Orxonox/explosion22 particle_system Orxonox/explosion2 3 3 { 4 4 quota 150 -
code/branches/resource2/data/particle/explosion2b.particle
r5354 r5689 1 1 2 Orxonox/explosion2b2 particle_system Orxonox/explosion2b 3 3 { 4 4 quota 150 -
code/branches/resource2/data/particle/explosion3.particle
r5379 r5689 1 1 2 Orxonox/explosion32 particle_system Orxonox/explosion3 3 3 { 4 4 quota 10 -
code/branches/resource2/data/particle/fairytwirl.particle
r5352 r5689 1 1 2 Orxonox/fairytwirl2 particle_system Orxonox/fairytwirl 3 3 { 4 4 quota 500 -
code/branches/resource2/data/particle/fire3.particle
r5352 r5689 1 1 2 Orxonox/fire32 particle_system Orxonox/fire3 3 3 { 4 4 quota 50 -
code/branches/resource2/data/particle/fire4.particle
r5542 r5689 1 1 2 Orxonox/fire42 particle_system Orxonox/fire4 3 3 { 4 4 quota 25 -
code/branches/resource2/data/particle/forcefield.particle
r5556 r5689 1 Orxonox/ForceFieldPurpleBig1 particle_system Orxonox/ForceFieldPurpleBig 2 2 { 3 3 quota 10000 … … 91 91 } 92 92 93 Orxonox/ForceFieldPurpleSmall93 particle_system Orxonox/ForceFieldPurpleSmall 94 94 { 95 95 quota 10000 … … 183 183 } 184 184 185 Orxonox/ForceFieldGreenBig185 particle_system Orxonox/ForceFieldGreenBig 186 186 { 187 187 quota 10000 … … 275 275 } 276 276 277 Orxonox/ForceFieldGreenSmall277 particle_system Orxonox/ForceFieldGreenSmall 278 278 { 279 279 quota 10000 … … 370 370 371 371 372 Orxonox/ForceFieldBlueBig372 particle_system Orxonox/ForceFieldBlueBig 373 373 { 374 374 quota 10000 … … 462 462 } 463 463 464 Orxonox/ForceFieldBlueSmall464 particle_system Orxonox/ForceFieldBlueSmall 465 465 { 466 466 quota 10000 -
code/branches/resource2/data/particle/ray1.particle
r5352 r5689 1 1 2 Orxonox/ray12 particle_system Orxonox/ray1 3 3 { 4 4 quota 1000 -
code/branches/resource2/data/particle/ray2.particle
r5352 r5689 1 1 2 Orxonox/ray22 particle_system Orxonox/ray2 3 3 { 4 4 quota 1200 -
code/branches/resource2/data/particle/repairGold.particle
r5558 r5689 1 1 2 Orxonox/repairGold2 particle_system Orxonox/repairGold 3 3 { 4 4 quota 200 -
code/branches/resource2/data/particle/repairSilver.particle
r5558 r5689 1 1 2 Orxonox/repairSilver2 particle_system Orxonox/repairSilver 3 3 { 4 4 quota 500 -
code/branches/resource2/data/particle/shot1.particle
r5352 r5689 1 Orxonox/shot11 particle_system Orxonox/shot1 2 2 { 3 3 quota 5000 -
code/branches/resource2/data/particle/shot2.particle
r5352 r5689 1 1 2 Orxonox/shot22 particle_system Orxonox/shot2 3 3 { 4 4 quota 25 -
code/branches/resource2/data/particle/shot2_small.particle
r5352 r5689 1 1 2 Orxonox/shot2_small2 particle_system Orxonox/shot2_small 3 3 { 4 4 quota 25 -
code/branches/resource2/data/particle/shot3_small.particle
r5352 r5689 1 1 2 Orxonox/shot3_small2 particle_system Orxonox/shot3_small 3 3 { 4 4 quota 25 -
code/branches/resource2/data/particle/shotTest.particle
r5539 r5689 1 1 2 Orxonox/shotTest2 particle_system Orxonox/shotTest 3 3 { 4 4 quota 3000 -
code/branches/resource2/data/particle/smoke1.particle
r5352 r5689 2 2 3 3 // smoke 4 Examples/Smoke4 particle_system Examples/Smoke 5 5 { 6 6 material Examples/Smoke -
code/branches/resource2/data/particle/smoke2.particle
r5352 r5689 1 1 2 Orxonox/smoke22 particle_system Orxonox/smoke2 3 3 { 4 4 quota 1000 -
code/branches/resource2/data/particle/smoke3.particle
r5352 r5689 1 1 2 Orxonox/smoke32 particle_system Orxonox/smoke3 3 3 { 4 4 quota 10 -
code/branches/resource2/data/particle/smoke4.particle
r5379 r5689 1 1 2 Orxonox/smoke42 particle_system Orxonox/smoke4 3 3 { 4 4 quota 10 -
code/branches/resource2/data/particle/smoke5.particle
r5352 r5689 1 1 2 Orxonox/smoke52 particle_system Orxonox/smoke5 3 3 { 4 4 quota 80 -
code/branches/resource2/data/particle/smoke6.particle
r5357 r5689 1 1 2 Orxonox/smoke62 particle_system Orxonox/smoke6 3 3 { 4 4 quota 50 -
code/branches/resource2/data/particle/smoke7.particle
r5352 r5689 1 1 2 Orxonox/smoke72 particle_system Orxonox/smoke7 3 3 { 4 4 quota 25 -
code/branches/resource2/data/particle/sparks.particle
r5352 r5689 1 1 2 Orxonox/sparks2 particle_system Orxonox/sparks 3 3 { 4 4 quota 100 -
code/branches/resource2/data/particle/thruster1.particle
r5352 r5689 1 Orxonox/thruster11 particle_system Orxonox/thruster1 2 2 { 3 3 quota 100 -
code/branches/resource2/data/particle/thruster2.particle
r5352 r5689 1 Orxonox/thruster21 particle_system Orxonox/thruster2 2 2 { 3 3 quota 150 -
code/branches/resource2/data/particle/thruster3.particle
r5352 r5689 1 Orxonox/thruster31 particle_system Orxonox/thruster3 2 2 { 3 3 quota 100 -
code/branches/resource2/src/core/CMakeLists.txt
r5654 r5689 31 31 Language.cc 32 32 LuaState.cc 33 MemoryArchive.cc 33 34 ObjectListBase.cc 34 35 OrxonoxClass.cc -
code/branches/resource2/src/core/CorePrereqs.h
r5654 r5689 134 134 class Loader; 135 135 class LuaState; 136 class MemoryArchive; 137 class MemoryArchiveFactory; 136 138 class MetaObjectList; 137 139 class MetaObjectListElement; -
code/branches/resource2/src/core/GraphicsManager.cc
r5682 r5689 28 28 */ 29 29 30 /**31 @file32 @brief33 Implementation of an partial interface to Ogre.34 */35 36 30 #include "GraphicsManager.h" 37 31 38 32 #include <fstream> 33 #include <sstream> 39 34 #include <boost/filesystem.hpp> 40 35 #include <boost/shared_array.hpp> 36 37 #include <OgreArchiveFactory.h> 38 #include <OgreArchiveManager.h> 41 39 #include <OgreFrameListener.h> 42 40 #include <OgreRoot.h> 43 41 #include <OgreLogManager.h> 44 #include <OgreException.h>45 42 #include <OgreRenderWindow.h> 46 43 #include <OgreRenderSystem.h> … … 62 59 #include "GameMode.h" 63 60 #include "Loader.h" 61 #include "MemoryArchive.h" 64 62 #include "WindowEventListener.h" 65 63 #include "XMLFile.h" … … 88 86 GraphicsManager::GraphicsManager(bool bLoadRenderer) 89 87 : ogreWindowEventListener_(new OgreWindowEventListener()) 88 #if OGRE_VERSION < 0x010600 89 , memoryArchiveFactory_(new MemoryArchiveFactory()) 90 #endif 90 91 , renderWindow_(0) 91 92 , viewport_(0) … … 165 166 166 167 this->loadRenderer(); 168 169 #if OGRE_VERSION < 0x010600 170 // WORKAROUND: There is an incompatibility for particle scripts when trying 171 // to support both Ogre 1.4 and 1.6. The hacky solution is to create 172 // scripts for the 1.6 version and then remove the inserted "particle_system" 173 // keyword. But we need to supply these new scripts as well, which is why 174 // there is an extra Ogre::Archive dealing with in the memory. 175 using namespace Ogre; 176 ArchiveManager::getSingleton().addArchiveFactory(memoryArchiveFactory_.get()); 177 const StringVector& groups = ResourceGroupManager::getSingleton().getResourceGroups(); 178 // Travers all groups 179 for (StringVector::const_iterator itGroup = groups.begin(); itGroup != groups.end(); ++itGroup) 180 { 181 FileInfoListPtr files = ResourceGroupManager::getSingleton().findResourceFileInfo(*itGroup, "*.particle"); 182 for (FileInfoList::const_iterator itFile = files->begin(); itFile != files->end(); ++itFile) 183 { 184 // open file 185 Ogre::DataStreamPtr input = ResourceGroupManager::getSingleton().openResource(itFile->filename, *itGroup, false); 186 std::stringstream output; 187 // Parse file and replace "particle_system" with nothing 188 while (!input->eof()) 189 { 190 std::string line = input->getLine(); 191 size_t pos = line.find("particle_system"); 192 if (pos != std::string::npos) 193 { 194 // 15 is the length of "particle_system" 195 line.replace(pos, 15, ""); 196 } 197 output << line << std::endl; 198 } 199 // Add file to the memory archive 200 shared_array<char> data(new char[output.str().size()]); 201 // Debug optimisations 202 const std::string outputStr = output.str(); 203 char* rawData = data.get(); 204 for (unsigned i = 0; i < outputStr.size(); ++i) 205 rawData[i] = outputStr[i]; 206 MemoryArchive::addFile("particle_scripts_ogre_1.4_" + *itGroup, itFile->filename, data, output.str().size()); 207 } 208 if (!files->empty()) 209 { 210 // Declare the files, but using a new group 211 ResourceGroupManager::getSingleton().addResourceLocation("particle_scripts_ogre_1.4_" + *itGroup, 212 "Memory", "particle_scripts_ogre_1.4_" + *itGroup); 213 } 214 } 215 #endif 167 216 168 217 // Initialise all resources (do this AFTER the renderer has been loaded!) -
code/branches/resource2/src/core/GraphicsManager.h
r5670 r5689 91 91 92 92 scoped_ptr<OgreWindowEventListener> ogreWindowEventListener_; //!< Pimpl to hide OgreWindowUtilities.h 93 #if OGRE_VERSION < 0x010600 94 scoped_ptr<MemoryArchiveFactory> memoryArchiveFactory_; //!< Stores the modified particle scripts 95 #endif 93 96 scoped_ptr<Ogre::LogManager> ogreLogger_; 94 97 scoped_ptr<Ogre::Root> ogreRoot_; //!< Ogre's root
Note: See TracChangeset
for help on using the changeset viewer.