[Orxonox-commit 966] r5689 - in code/branches/resource2: cmake data/particle src/core

rgrieder at orxonox.net rgrieder at orxonox.net
Sat Aug 29 22:04:05 CEST 2009


Author: rgrieder
Date: 2009-08-29 22:04:04 +0200 (Sat, 29 Aug 2009)
New Revision: 5689

Added:
   code/branches/resource2/src/core/MemoryArchive.cc
   code/branches/resource2/src/core/MemoryArchive.h
Modified:
   code/branches/resource2/cmake/LibraryConfig.cmake
   code/branches/resource2/data/particle/Example-Water.particle
   code/branches/resource2/data/particle/Example.particle
   code/branches/resource2/data/particle/ExplosionComp1.particle
   code/branches/resource2/data/particle/ExplosionComp2.particle
   code/branches/resource2/data/particle/ExplosionComp4.particle
   code/branches/resource2/data/particle/FireComp2.particle
   code/branches/resource2/data/particle/LaserGun.particle
   code/branches/resource2/data/particle/ThrusterFire.particle
   code/branches/resource2/data/particle/bigexplosion1part1.particle
   code/branches/resource2/data/particle/bigexplosion1part2.particle
   code/branches/resource2/data/particle/bigexplosion1part3.particle
   code/branches/resource2/data/particle/emitted_emitter.particle
   code/branches/resource2/data/particle/engineglow.particle
   code/branches/resource2/data/particle/explosion1.particle
   code/branches/resource2/data/particle/explosion2.particle
   code/branches/resource2/data/particle/explosion2b.particle
   code/branches/resource2/data/particle/explosion3.particle
   code/branches/resource2/data/particle/fairytwirl.particle
   code/branches/resource2/data/particle/fire3.particle
   code/branches/resource2/data/particle/fire4.particle
   code/branches/resource2/data/particle/forcefield.particle
   code/branches/resource2/data/particle/ray1.particle
   code/branches/resource2/data/particle/ray2.particle
   code/branches/resource2/data/particle/repairGold.particle
   code/branches/resource2/data/particle/repairSilver.particle
   code/branches/resource2/data/particle/shot1.particle
   code/branches/resource2/data/particle/shot2.particle
   code/branches/resource2/data/particle/shot2_small.particle
   code/branches/resource2/data/particle/shot3_small.particle
   code/branches/resource2/data/particle/shotTest.particle
   code/branches/resource2/data/particle/smoke1.particle
   code/branches/resource2/data/particle/smoke2.particle
   code/branches/resource2/data/particle/smoke3.particle
   code/branches/resource2/data/particle/smoke4.particle
   code/branches/resource2/data/particle/smoke5.particle
   code/branches/resource2/data/particle/smoke6.particle
   code/branches/resource2/data/particle/smoke7.particle
   code/branches/resource2/data/particle/sparks.particle
   code/branches/resource2/data/particle/thruster1.particle
   code/branches/resource2/data/particle/thruster2.particle
   code/branches/resource2/data/particle/thruster3.particle
   code/branches/resource2/src/core/CMakeLists.txt
   code/branches/resource2/src/core/CorePrereqs.h
   code/branches/resource2/src/core/GraphicsManager.cc
   code/branches/resource2/src/core/GraphicsManager.h
Log:
Experimental support for OGRE v1.6 "Shoggoth".
I had to write a little script that removes all the "particle_system" keywords from the particle scripts. But since we can't write to the media folder and creating unique temporary folders is quite tedious, I derived from Ogre::Archive and created a little MemoryArchive that accepts those new particle scripts and feeds them back to the Ogre::ResourceGroupManager.
Also adjusted all particle scripts for the new script compiler (i.e. just added "particle_system" everywhere).

Note: It seems that overlays don't work anymore on Windows, compiling with MinGW.

Modified: code/branches/resource2/cmake/LibraryConfig.cmake
===================================================================
--- code/branches/resource2/cmake/LibraryConfig.cmake	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/cmake/LibraryConfig.cmake	2009-08-29 20:04:04 UTC (rev 5689)
@@ -84,7 +84,7 @@
 ############### Library finding #################
 # Performs the search and sets the variables    #
 
-FIND_PACKAGE(OGRE  1.4 EXACT REQUIRED)
+FIND_PACKAGE(OGRE  1.4       REQUIRED)
 FIND_PACKAGE(ENet  1.1       REQUIRED)
 FIND_PACKAGE(Ogg             REQUIRED)
 FIND_PACKAGE(Vorbis          REQUIRED)

Modified: code/branches/resource2/data/particle/Example-Water.particle
===================================================================
--- code/branches/resource2/data/particle/Example-Water.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/Example-Water.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,4 +1,4 @@
-Examples/Water/Rain
+particle_system Examples/Water/Rain
 {
     material        Examples/Droplet
     particle_width  100

Modified: code/branches/resource2/data/particle/Example.particle
===================================================================
--- code/branches/resource2/data/particle/Example.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/Example.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,7 +1,7 @@
 // Example particle systems
 
 // Exudes greeny particles which float upwards
-Examples/GreenyNimbus
+particle_system Examples/GreenyNimbus
 {
     material        Examples/FlarePointSprite
 	point_rendering	true
@@ -48,7 +48,7 @@
 }
 
 // A sparkly purple fountain
-Examples/PurpleFountain
+particle_system Examples/PurpleFountain
 {
     material        Examples/Flare2
     particle_width  20
@@ -88,7 +88,7 @@
 
 
 // A downpour
-Examples/Rain
+particle_system Examples/Rain
 {
     material        Examples/Droplet
     particle_width  20
@@ -124,7 +124,7 @@
 }
 
 // A jet engine (of sorts)
-Examples/JetEngine1
+particle_system Examples/JetEngine1
 {
 	material 		Examples/Flare
 	particle_width 	25
@@ -153,7 +153,7 @@
 	}
 	
 }
-Examples/JetEngine2
+particle_system Examples/JetEngine2
 {
 	material 		Examples/Flare
 	particle_width 	15
@@ -184,7 +184,7 @@
 }
 
 // Exudes aureola particles which around the model float upwards
-Examples/Aureola
+particle_system Examples/Aureola
 {
     material        Examples/Aureola
     particle_width  200
@@ -246,7 +246,7 @@
 }
 
 
-Examples/Swarm
+particle_system Examples/Swarm
 {
 	quota	3000
 	material	Examples/Flare2
@@ -341,7 +341,7 @@
 }
 
 
-Examples/Snow
+particle_system Examples/Snow
 {
 	quota	2000
 	material	Examples/Flare

Modified: code/branches/resource2/data/particle/ExplosionComp1.particle
===================================================================
--- code/branches/resource2/data/particle/ExplosionComp1.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/ExplosionComp1.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/ExplosionComp1
+particle_system Orxonox/ExplosionComp1
 {
 	quota	150
 	material	PE/explosion

Modified: code/branches/resource2/data/particle/ExplosionComp2.particle
===================================================================
--- code/branches/resource2/data/particle/ExplosionComp2.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/ExplosionComp2.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/ExplosionComp2
+particle_system Orxonox/ExplosionComp2
 {
 	quota	1000
 	material	PE/smoke

Modified: code/branches/resource2/data/particle/ExplosionComp4.particle
===================================================================
--- code/branches/resource2/data/particle/ExplosionComp4.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/ExplosionComp4.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-ExplosionComp4
+particle_system ExplosionComp4
 {
 	quota	10
 	material	BaseWhite
@@ -19,7 +19,7 @@
 	accurate_facing	false
 }
 
-Orxonox/ExplosionComp4
+particle_system Orxonox/ExplosionComp4
 {
 	quota	500
 	material	PE/explosion

Modified: code/branches/resource2/data/particle/FireComp2.particle
===================================================================
--- code/branches/resource2/data/particle/FireComp2.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/FireComp2.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/FireComp2
+particle_system Orxonox/FireComp2
 {
 	quota	10000
 	material	PE/smoke

Modified: code/branches/resource2/data/particle/LaserGun.particle
===================================================================
--- code/branches/resource2/data/particle/LaserGun.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/LaserGun.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/LaserGun
+particle_system Orxonox/LaserGun
 {
 	quota	1000
 	material	PE/Streak

Modified: code/branches/resource2/data/particle/ThrusterFire.particle
===================================================================
--- code/branches/resource2/data/particle/ThrusterFire.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/ThrusterFire.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/ThrusterFire
+particle_system Orxonox/ThrusterFire
 {
 	quota	50
 	material	PE/explosion3

Modified: code/branches/resource2/data/particle/bigexplosion1part1.particle
===================================================================
--- code/branches/resource2/data/particle/bigexplosion1part1.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/bigexplosion1part1.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/BigExplosion1part1
+particle_system Orxonox/BigExplosion1part1
 {
 	quota	100
 	material	PE/Flare

Modified: code/branches/resource2/data/particle/bigexplosion1part2.particle
===================================================================
--- code/branches/resource2/data/particle/bigexplosion1part2.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/bigexplosion1part2.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/BigExplosion1part2
+particle_system Orxonox/BigExplosion1part2
 {
 	quota	50
 	material	PE/ringflare

Modified: code/branches/resource2/data/particle/bigexplosion1part3.particle
===================================================================
--- code/branches/resource2/data/particle/bigexplosion1part3.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/bigexplosion1part3.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/BigExplosion1part3
+particle_system Orxonox/BigExplosion1part3
 {
 	quota	120
 	material	PE/point_lensflare

Modified: code/branches/resource2/data/particle/emitted_emitter.particle
===================================================================
--- code/branches/resource2/data/particle/emitted_emitter.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/emitted_emitter.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 // Example emitted emitters
-Examples/Fireworks
+particle_system Examples/Fireworks
 {
      material Examples/Flare
      point_rendering            false

Modified: code/branches/resource2/data/particle/engineglow.particle
===================================================================
--- code/branches/resource2/data/particle/engineglow.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/engineglow.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/engineglow
+particle_system Orxonox/engineglow
 {
 	quota	200
 	material	PE/bigFlame

Modified: code/branches/resource2/data/particle/explosion1.particle
===================================================================
--- code/branches/resource2/data/particle/explosion1.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/explosion1.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/explosion1
+particle_system Orxonox/explosion1
 {
 	quota	200
 	material	PE/explosion

Modified: code/branches/resource2/data/particle/explosion2.particle
===================================================================
--- code/branches/resource2/data/particle/explosion2.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/explosion2.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/explosion2
+particle_system Orxonox/explosion2
 {
 	quota	150
 	material	PE/explosion

Modified: code/branches/resource2/data/particle/explosion2b.particle
===================================================================
--- code/branches/resource2/data/particle/explosion2b.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/explosion2b.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/explosion2b
+particle_system Orxonox/explosion2b
 {
 	quota	150
 	material	PE/explosion

Modified: code/branches/resource2/data/particle/explosion3.particle
===================================================================
--- code/branches/resource2/data/particle/explosion3.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/explosion3.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/explosion3
+particle_system Orxonox/explosion3
 {
 	quota	10
 	material	PE/explosion3

Modified: code/branches/resource2/data/particle/fairytwirl.particle
===================================================================
--- code/branches/resource2/data/particle/fairytwirl.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/fairytwirl.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/fairytwirl
+particle_system Orxonox/fairytwirl
 {
 	quota	500
 	material	PE/lensflare

Modified: code/branches/resource2/data/particle/fire3.particle
===================================================================
--- code/branches/resource2/data/particle/fire3.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/fire3.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/fire3
+particle_system Orxonox/fire3
 {
 	quota	50
 	material	PE/explosion3

Modified: code/branches/resource2/data/particle/fire4.particle
===================================================================
--- code/branches/resource2/data/particle/fire4.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/fire4.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/fire4
+particle_system Orxonox/fire4
 {
 	quota	25
 	material	PE/explosion3

Modified: code/branches/resource2/data/particle/forcefield.particle
===================================================================
--- code/branches/resource2/data/particle/forcefield.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/forcefield.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,4 +1,4 @@
-Orxonox/ForceFieldPurpleBig
+particle_system Orxonox/ForceFieldPurpleBig
 {
 	quota	10000
 	material	PE/smoke
@@ -90,7 +90,7 @@
 	}
 }
 
-Orxonox/ForceFieldPurpleSmall
+particle_system Orxonox/ForceFieldPurpleSmall
 {
 	quota	10000
 	material	PE/smoke
@@ -182,7 +182,7 @@
 	}
 }	
 
-Orxonox/ForceFieldGreenBig
+particle_system Orxonox/ForceFieldGreenBig
 {
 	quota	10000
 	material	PE/smoke
@@ -274,7 +274,7 @@
 	}
 }
 
-Orxonox/ForceFieldGreenSmall
+particle_system Orxonox/ForceFieldGreenSmall
 {
 	quota	10000
 	material	PE/smoke
@@ -369,7 +369,7 @@
 }
 
 			
-Orxonox/ForceFieldBlueBig
+particle_system Orxonox/ForceFieldBlueBig
 {
 	quota	10000
 	material	PE/smoke
@@ -461,7 +461,7 @@
 	}
 }
 
-Orxonox/ForceFieldBlueSmall
+particle_system Orxonox/ForceFieldBlueSmall
 {
 	quota	10000
 	material	PE/smoke

Modified: code/branches/resource2/data/particle/ray1.particle
===================================================================
--- code/branches/resource2/data/particle/ray1.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/ray1.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/ray1
+particle_system Orxonox/ray1
 {
 	quota	1000
 	material	PE/lensflare

Modified: code/branches/resource2/data/particle/ray2.particle
===================================================================
--- code/branches/resource2/data/particle/ray2.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/ray2.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/ray2
+particle_system Orxonox/ray2
 {
 	quota	1200
 	material	PE/lensflare

Modified: code/branches/resource2/data/particle/repairGold.particle
===================================================================
--- code/branches/resource2/data/particle/repairGold.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/repairGold.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/repairGold
+particle_system Orxonox/repairGold
 {
 	quota	200
 	material	PE/lensflare

Modified: code/branches/resource2/data/particle/repairSilver.particle
===================================================================
--- code/branches/resource2/data/particle/repairSilver.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/repairSilver.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/repairSilver
+particle_system Orxonox/repairSilver
 {
 	quota	500
 	material	PE/lensflare

Modified: code/branches/resource2/data/particle/shot1.particle
===================================================================
--- code/branches/resource2/data/particle/shot1.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/shot1.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,4 +1,4 @@
-Orxonox/shot1
+particle_system Orxonox/shot1
 {
 	quota	5000
 	material	PE/lensflare

Modified: code/branches/resource2/data/particle/shot2.particle
===================================================================
--- code/branches/resource2/data/particle/shot2.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/shot2.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/shot2
+particle_system Orxonox/shot2
 {
 	quota	25
 	material	PE/point_lensflare

Modified: code/branches/resource2/data/particle/shot2_small.particle
===================================================================
--- code/branches/resource2/data/particle/shot2_small.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/shot2_small.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/shot2_small
+particle_system Orxonox/shot2_small
 {
 	quota	25
 	material	PE/point_lensflare

Modified: code/branches/resource2/data/particle/shot3_small.particle
===================================================================
--- code/branches/resource2/data/particle/shot3_small.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/shot3_small.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/shot3_small
+particle_system Orxonox/shot3_small
 {
 	quota	25
 	material	PE/point_lensflare

Modified: code/branches/resource2/data/particle/shotTest.particle
===================================================================
--- code/branches/resource2/data/particle/shotTest.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/shotTest.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/shotTest
+particle_system Orxonox/shotTest
 {
 	quota	3000
 	material	PE/bigFlame

Modified: code/branches/resource2/data/particle/smoke1.particle
===================================================================
--- code/branches/resource2/data/particle/smoke1.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/smoke1.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,7 +1,7 @@
 // Example particle systems
 
 // smoke
-Examples/Smoke
+particle_system Examples/Smoke
 {
     	material        	Examples/Smoke
     	particle_width  	55

Modified: code/branches/resource2/data/particle/smoke2.particle
===================================================================
--- code/branches/resource2/data/particle/smoke2.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/smoke2.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/smoke2
+particle_system Orxonox/smoke2
 {
 	quota	1000
 	material	PE/smoke

Modified: code/branches/resource2/data/particle/smoke3.particle
===================================================================
--- code/branches/resource2/data/particle/smoke3.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/smoke3.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/smoke3
+particle_system Orxonox/smoke3
 {
 	quota	10
 	material	PE/smoke2

Modified: code/branches/resource2/data/particle/smoke4.particle
===================================================================
--- code/branches/resource2/data/particle/smoke4.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/smoke4.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/smoke4
+particle_system Orxonox/smoke4
 {
 	quota	10
 	material	PE/smoke3

Modified: code/branches/resource2/data/particle/smoke5.particle
===================================================================
--- code/branches/resource2/data/particle/smoke5.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/smoke5.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/smoke5
+particle_system Orxonox/smoke5
 {
 	quota	80
 	material	PE/smoke3

Modified: code/branches/resource2/data/particle/smoke6.particle
===================================================================
--- code/branches/resource2/data/particle/smoke6.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/smoke6.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/smoke6
+particle_system Orxonox/smoke6
 {
 	quota	50
 	material	PE/smoke2

Modified: code/branches/resource2/data/particle/smoke7.particle
===================================================================
--- code/branches/resource2/data/particle/smoke7.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/smoke7.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/smoke7
+particle_system Orxonox/smoke7
 {
 	quota	25
 	material	PE/smoke2

Modified: code/branches/resource2/data/particle/sparks.particle
===================================================================
--- code/branches/resource2/data/particle/sparks.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/sparks.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,5 +1,5 @@
 
-Orxonox/sparks
+particle_system Orxonox/sparks
 {
 	quota	100
 	material	PE/lensflare

Modified: code/branches/resource2/data/particle/thruster1.particle
===================================================================
--- code/branches/resource2/data/particle/thruster1.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/thruster1.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,4 +1,4 @@
-Orxonox/thruster1
+particle_system Orxonox/thruster1
 {
 	quota	100
 	material	PE/bigFlame

Modified: code/branches/resource2/data/particle/thruster2.particle
===================================================================
--- code/branches/resource2/data/particle/thruster2.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/thruster2.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,4 +1,4 @@
-Orxonox/thruster2
+particle_system Orxonox/thruster2
 {
 	quota	150
 	material	PE/bigFlame

Modified: code/branches/resource2/data/particle/thruster3.particle
===================================================================
--- code/branches/resource2/data/particle/thruster3.particle	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/data/particle/thruster3.particle	2009-08-29 20:04:04 UTC (rev 5689)
@@ -1,4 +1,4 @@
-Orxonox/thruster3
+particle_system Orxonox/thruster3
 {
 	quota	100
 	material	PE/bigFlame

Modified: code/branches/resource2/src/core/CMakeLists.txt
===================================================================
--- code/branches/resource2/src/core/CMakeLists.txt	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/src/core/CMakeLists.txt	2009-08-29 20:04:04 UTC (rev 5689)
@@ -30,6 +30,7 @@
   GUIManager.cc
   Language.cc
   LuaState.cc
+  MemoryArchive.cc
   ObjectListBase.cc
   OrxonoxClass.cc
   Resource.cc

Modified: code/branches/resource2/src/core/CorePrereqs.h
===================================================================
--- code/branches/resource2/src/core/CorePrereqs.h	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/src/core/CorePrereqs.h	2009-08-29 20:04:04 UTC (rev 5689)
@@ -133,6 +133,8 @@
     class LanguageEntry;
     class Loader;
     class LuaState;
+    class MemoryArchive;
+    class MemoryArchiveFactory;
     class MetaObjectList;
     class MetaObjectListElement;
     class Namespace;

Modified: code/branches/resource2/src/core/GraphicsManager.cc
===================================================================
--- code/branches/resource2/src/core/GraphicsManager.cc	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/src/core/GraphicsManager.cc	2009-08-29 20:04:04 UTC (rev 5689)
@@ -27,21 +27,18 @@
  *
  */
 
-/**
- at file
- at brief
-    Implementation of an partial interface to Ogre.
-*/
-
 #include "GraphicsManager.h"
 
 #include <fstream>
+#include <sstream>
 #include <boost/filesystem.hpp>
+#include <boost/shared_array.hpp>
 
+#include <OgreArchiveFactory.h>
+#include <OgreArchiveManager.h>
 #include <OgreFrameListener.h>
 #include <OgreRoot.h>
 #include <OgreLogManager.h>
-#include <OgreException.h>
 #include <OgreRenderWindow.h>
 #include <OgreRenderSystem.h>
 #include <OgreResourceGroupManager.h>
@@ -61,6 +58,7 @@
 #include "Game.h"
 #include "GameMode.h"
 #include "Loader.h"
+#include "MemoryArchive.h"
 #include "WindowEventListener.h"
 #include "XMLFile.h"
 
@@ -87,6 +85,9 @@
     */
     GraphicsManager::GraphicsManager(bool bLoadRenderer)
         : ogreWindowEventListener_(new OgreWindowEventListener())
+#if OGRE_VERSION < 0x010600
+        , memoryArchiveFactory_(new MemoryArchiveFactory())
+#endif
         , renderWindow_(0)
         , viewport_(0)
     {
@@ -165,6 +166,54 @@
 
         this->loadRenderer();
 
+#if OGRE_VERSION < 0x010600
+        // WORKAROUND: There is an incompatibility for particle scripts when trying
+        // to support both Ogre 1.4 and 1.6. The hacky solution is to create
+        // scripts for the 1.6 version and then remove the inserted "particle_system"
+        // keyword. But we need to supply these new scripts as well, which is why
+        // there is an extra Ogre::Archive dealing with in the memory.
+        using namespace Ogre;
+        ArchiveManager::getSingleton().addArchiveFactory(memoryArchiveFactory_.get());
+        const StringVector& groups = ResourceGroupManager::getSingleton().getResourceGroups();
+        // Travers all groups
+        for (StringVector::const_iterator itGroup = groups.begin(); itGroup != groups.end(); ++itGroup)
+        {
+            FileInfoListPtr files = ResourceGroupManager::getSingleton().findResourceFileInfo(*itGroup, "*.particle");
+            for (FileInfoList::const_iterator itFile = files->begin(); itFile != files->end(); ++itFile)
+            {
+                // open file
+                Ogre::DataStreamPtr input = ResourceGroupManager::getSingleton().openResource(itFile->filename, *itGroup, false);
+                std::stringstream output;
+                // Parse file and replace "particle_system" with nothing
+                while (!input->eof())
+                {
+                    std::string line = input->getLine();
+                    size_t pos = line.find("particle_system");
+                    if (pos != std::string::npos)
+                    {
+                        // 15 is the length of "particle_system"
+                        line.replace(pos, 15, "");
+                    }
+                    output << line << std::endl;
+                }
+                // Add file to the memory archive
+                shared_array<char> data(new char[output.str().size()]);
+                // Debug optimisations
+                const std::string outputStr = output.str();
+                char* rawData = data.get();
+                for (unsigned i = 0; i < outputStr.size(); ++i)
+                    rawData[i] = outputStr[i];
+                MemoryArchive::addFile("particle_scripts_ogre_1.4_" + *itGroup, itFile->filename, data, output.str().size());
+            }
+            if (!files->empty())
+            {
+                // Declare the files, but using a new group
+                ResourceGroupManager::getSingleton().addResourceLocation("particle_scripts_ogre_1.4_" + *itGroup,
+                    "Memory", "particle_scripts_ogre_1.4_" + *itGroup);
+            }
+        }
+#endif
+
         // Initialise all resources (do this AFTER the renderer has been loaded!)
         // Note: You can only do this once! Ogre will check whether a resource group has
         // already been initialised. If you need to load resources later, you will have to

Modified: code/branches/resource2/src/core/GraphicsManager.h
===================================================================
--- code/branches/resource2/src/core/GraphicsManager.h	2009-08-29 20:00:10 UTC (rev 5688)
+++ code/branches/resource2/src/core/GraphicsManager.h	2009-08-29 20:04:04 UTC (rev 5689)
@@ -90,6 +90,9 @@
         void printScreen();
 
         scoped_ptr<OgreWindowEventListener> ogreWindowEventListener_; //!< Pimpl to hide OgreWindowUtilities.h
+#if OGRE_VERSION < 0x010600
+        scoped_ptr<MemoryArchiveFactory>    memoryArchiveFactory_;    //!< Stores the modified particle scripts
+#endif
         scoped_ptr<Ogre::LogManager>        ogreLogger_;
         scoped_ptr<Ogre::Root>              ogreRoot_;                //!< Ogre's root
         Ogre::RenderWindow* renderWindow_;             //!< the one and only render window

Added: code/branches/resource2/src/core/MemoryArchive.cc
===================================================================
--- code/branches/resource2/src/core/MemoryArchive.cc	                        (rev 0)
+++ code/branches/resource2/src/core/MemoryArchive.cc	2009-08-29 20:04:04 UTC (rev 5689)
@@ -0,0 +1,133 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "MemoryArchive.h"
+
+#if OGRE_VERSION < 0x010600
+
+#include <OgreException.h>
+#include <boost/filesystem.hpp>
+
+namespace orxonox
+{
+    using namespace Ogre;
+
+    MemoryArchive::ArchiveMap MemoryArchive::archives_s;
+
+    void MemoryArchive::load()
+    {
+        if (archives_s.find(this->getName()) == archives_s.end())
+            OGRE_EXCEPT(Ogre::Exception::ERR_INTERNAL_ERROR, this->getName() + " - MemoryArchive not found.", "MemoryArchive");
+    }
+
+    DataStreamPtr MemoryArchive::open(const String& filename) const
+    {
+        const FileMap& files = archives_s[this->getName()];
+        FileMap::const_iterator itFile = files.find(filename);
+        if (itFile == files.end())
+            return DataStreamPtr();
+        else
+            return MemoryDataStreamPtr(new MemoryDataStream(itFile->second.first.get(), itFile->second.second));
+    }
+
+    void MemoryArchive::findFiles(const String& pattern, bool bRecursive, 
+        bool bDirs, StringVector* simpleList, FileInfoList* detailList)
+    {
+        const FileMap& files = archives_s[this->getName()];
+
+        for (FileMap::const_iterator it = files.begin(); it != files.end(); ++it)
+        {
+            boost::filesystem::path file = it->first;
+            // Check pattern
+            if (!StringUtil::match(file.string(), pattern, true))
+                continue;
+            if (bDirs)
+                file = file.parent_path();
+            if (file.empty())
+                continue;
+            if (file.has_parent_path() && !bRecursive)
+                continue;
+            if (simpleList)
+                simpleList->push_back(file.string());
+            if (detailList)
+            {
+                FileInfo fi;
+                fi.archive = this;
+                fi.filename = file.string();
+                fi.basename = file.filename();
+                fi.path = file.parent_path().string();
+                fi.compressedSize = it->second.second;
+                fi.uncompressedSize = it->second.second;
+                detailList->push_back(fi);
+            }
+        }
+    }
+    StringVectorPtr MemoryArchive::list(bool recursive, bool dirs)
+    {
+        StringVectorPtr ret(new StringVector());
+        findFiles("*", recursive, dirs, ret.getPointer(), 0);
+        return ret;
+    }
+
+    FileInfoListPtr MemoryArchive::listFileInfo(bool recursive, bool dirs)
+    {
+        FileInfoListPtr ret(new FileInfoList());
+        findFiles("*", recursive, dirs, 0, ret.getPointer());
+        return ret;
+    }
+
+    StringVectorPtr MemoryArchive::find(const String& pattern,
+                                            bool recursive, bool dirs)
+    {
+        StringVectorPtr ret(new StringVector());
+        findFiles(pattern, recursive, dirs, ret.getPointer(), 0);
+        return ret;
+    }
+
+    FileInfoListPtr MemoryArchive::findFileInfo(const String& pattern, 
+        bool recursive, bool dirs)
+    {
+        FileInfoListPtr ret(new FileInfoList());
+        findFiles(pattern, recursive, dirs, 0, ret.getPointer());
+        return ret;
+    }
+
+    bool MemoryArchive::exists(const String& filename)
+	{
+        const FileMap& files = archives_s[this->getName()];
+        return files.find(filename) != files.end();
+	}
+
+    const Ogre::String& MemoryArchiveFactory::getType(void) const
+    {
+        static std::string result("Memory");
+        return result;
+    }
+}
+
+#endif /* OGRE_VERSION < 0x010600 */


Property changes on: code/branches/resource2/src/core/MemoryArchive.cc
___________________________________________________________________
Added: svn:eol-style
   + native

Added: code/branches/resource2/src/core/MemoryArchive.h
===================================================================
--- code/branches/resource2/src/core/MemoryArchive.h	                        (rev 0)
+++ code/branches/resource2/src/core/MemoryArchive.h	2009-08-29 20:04:04 UTC (rev 5689)
@@ -0,0 +1,101 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *      Reto Grieder
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#ifndef _MemoryArchive_H__
+#define _MemoryArchive_H__
+
+#include "CorePrereqs.h"
+#include <OgrePrerequisites.h>
+
+#if OGRE_VERSION < 0x010600
+
+#include <map>
+#include <OgreArchive.h>
+#include <OgreArchiveFactory.h>
+#include <boost/shared_array.hpp>
+
+namespace orxonox
+{
+    /**
+    @brief
+        Provides a simple mechanism of 'memory mapped IO', but compatible for Ogre 1.4
+
+        Files are stored as shared_array<char> in a static map with the archive names
+        (imaging the different archives as resource locations). This map then contains
+        yet another map with the actual files.
+        If you want to know why we make such a fuss, contact GraphicsManager::upgradeToGraphics()
+        for more information.
+    */
+    class MemoryArchive : public Ogre::Archive
+    {
+    public:
+        MemoryArchive(const Ogre::String& name, const Ogre::String& archiveType) : Ogre::Archive(name, archiveType) { }
+        ~MemoryArchive() { }
+
+        bool isCaseSensitive(void) const { return true; }
+
+        void load();
+        void unload() { }
+
+        Ogre::DataStreamPtr open(const Ogre::String& filename) const;
+
+        Ogre::StringVectorPtr list(bool recursive = true, bool dirs = false);
+        Ogre::FileInfoListPtr listFileInfo(bool recursive = true, bool dirs = false);
+
+        Ogre::StringVectorPtr find(const Ogre::String& pattern, bool recursive = true,
+            bool dirs = false);
+        Ogre::FileInfoListPtr findFileInfo(const Ogre::String& pattern, bool recursive = true,
+            bool dirs = false);
+
+        bool exists(const Ogre::String& filename);
+
+        static void addFile(const std::string& archiveName, const std::string& filename, shared_array<char> content, size_t size)
+            { archives_s[archiveName][filename] = std::make_pair(content, size); }
+
+    private:
+        void findFiles(const Ogre::String& pattern, bool bRecursive, 
+            bool bDirs, Ogre::StringVector* simpleList, Ogre::FileInfoList* detailList);
+
+        typedef std::map<std::string, std::pair<shared_array<char>, size_t> > FileMap;
+        typedef std::map<std::string, FileMap> ArchiveMap;
+        static ArchiveMap archives_s;
+    };
+
+    //! Specialisation of ArchiveFactory for MemoryArchive.
+    class _CoreExport MemoryArchiveFactory : public Ogre::ArchiveFactory
+    {
+    public:
+        const Ogre::String& getType(void) const;
+        Ogre::Archive* createInstance(const Ogre::String& name) { return new MemoryArchive(name, "Memory"); }
+        void destroyInstance(Ogre::Archive* arch)               { delete arch; }
+    };
+}
+
+#endif /* OGRE_VERSION < 0x010600 */
+
+#endif /* _MemoryArchive_H__ */


Property changes on: code/branches/resource2/src/core/MemoryArchive.h
___________________________________________________________________
Added: svn:eol-style
   + native




More information about the Orxonox-commit mailing list