From: <ult...@us...> - 2007-07-07 17:06:07
|
Revision: 630 http://svn.sourceforge.net/opengate/?rev=630&view=rev Author: ultrasick Date: 2007-07-07 10:06:09 -0700 (Sat, 07 Jul 2007) Log Message: ----------- camera adjustments + uploading the octavius core which wheren't in svn jet + uploading data fromo opacma Modified Paths: -------------- trunk/data/stations/tauseti_core.blend trunk/data/stations/tauseti_wake.blend Added Paths: ----------- trunk/data/stations/octavius_core.blend trunk/data/stations/octavius_core.xml trunk/data/stations/tauseti_core.xml Added: trunk/data/stations/octavius_core.blend =================================================================== (Binary files differ) Property changes on: trunk/data/stations/octavius_core.blend ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/data/stations/octavius_core.xml =================================================================== (Binary files differ) Property changes on: trunk/data/stations/octavius_core.xml ___________________________________________________________________ Name: svn:mime-type + application/xml Name: svn:eol-style + native Modified: trunk/data/stations/tauseti_core.blend =================================================================== (Binary files differ) Added: trunk/data/stations/tauseti_core.xml =================================================================== (Binary files differ) Property changes on: trunk/data/stations/tauseti_core.xml ___________________________________________________________________ Name: svn:mime-type + application/xml Name: svn:eol-style + native Modified: trunk/data/stations/tauseti_wake.blend =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2007-07-28 14:21:12
|
Revision: 643 http://opengate.svn.sourceforge.net/opengate/?rev=643&view=rev Author: spom_spom Date: 2007-07-28 07:21:14 -0700 (Sat, 28 Jul 2007) Log Message: ----------- add tauseti wake with normalmapping texture for testing purposes Modified Paths: -------------- branches/ogsector/data/asteroids/asteroid.material branches/ogsector/ogre.cfg branches/ogsector/resources.cfg branches/ogsector/src/DeviceManager.cpp branches/ogsector/src/DeviceManager.h branches/ogsector/src/EntityManager.cpp branches/ogsector/src/GameStateManager.cpp branches/ogsector/src/Sector.cpp trunk/data/misc/testsector.xml Added Paths: ----------- branches/ogsector/data/materials/advancedMaterials.material branches/ogsector/data/materials/advancedMaterials.program branches/ogsector/data/textures/tausetiTile.png branches/ogsector/data/textures/tausetiTileBump.png trunk/data/stations/tauseti_wake.mesh Modified: branches/ogsector/data/asteroids/asteroid.material =================================================================== --- branches/ogsector/data/asteroids/asteroid.material 2007-07-27 16:55:08 UTC (rev 642) +++ branches/ogsector/data/asteroids/asteroid.material 2007-07-28 14:21:14 UTC (rev 643) @@ -1,34 +1,3 @@ -vertex_program Asteroid/BumpMapVP cg -{ - source Example_BumpMapping.cg - entry_point main_vp - profiles vs_1_1 arbvp1 -} - -// Bump map fragment program, support for this is optional -fragment_program Asteroid/BumpMapFP cg -{ - source Example_BumpMapping.cg - entry_point main_fp - profiles vs_1_1 arbfp1 fp20 -} - -// Bump map with specular vertex program, support for this is required -vertex_program Asteroid/BumpMapVPSpecular cg -{ - source Example_BumpMapping.cg - entry_point specular_vp - profiles vs_1_1 arbvp1 -} - -// Bump map fragment program, support for this is optional -fragment_program Asteroid/BumpMapFPSpecular cg -{ - source Example_BumpMapping.cg - entry_point specular_fp - profiles vs_1_1 arbfp1 fp20 -} - material Asteroid/BumpMapping { @@ -48,7 +17,7 @@ // NB we don't use fixed function here because GL does not like // mixing fixed function and vertex programs, depth fighting can // be an issue - vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture + vertex_program_ref BasicVertexPrograms/AmbientOneTextureUnified { param_named_auto worldViewProj worldviewproj_matrix param_named_auto ambient ambient_light_colour @@ -70,14 +39,14 @@ scene_blend add // Vertex program reference - vertex_program_ref Asteroid/BumpMapVP + vertex_program_ref BumpMapVP { param_named_auto lightPosition light_position_object_space 0 param_named_auto worldViewProj worldviewproj_matrix } // Fragment program - fragment_program_ref Asteroid/BumpMapFP + fragment_program_ref BumpMapFP { param_named_auto lightDiffuse light_diffuse_colour 0 } @@ -107,7 +76,7 @@ // NB we don't use fixed function here because GL does not like // mixing fixed function and vertex programs, depth fighting can // be an issue - vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture + vertex_program_ref BasicVertexPrograms/AmbientOneTextureUnified { param_named_auto worldViewProj worldviewproj_matrix param_named ambient float4 1 1 1 1 @@ -138,7 +107,7 @@ // NB we don't use fixed function here because GL does not like // mixing fixed function and vertex programs, depth fighting can // be an issue - vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture + vertex_program_ref BasicVertexPrograms/AmbientOneTextureUnified { param_named_auto worldViewProj worldviewproj_matrix param_named_auto ambient ambient_light_colour @@ -159,7 +128,7 @@ scene_blend add // Vertex program reference - vertex_program_ref Asteroid/BumpMapVP + vertex_program_ref BumpMapVP { param_named_auto lightPosition light_position_object_space 0 param_named_auto worldViewProj worldviewproj_matrix @@ -190,7 +159,7 @@ // NB we don't use fixed function here because GL does not like // mixing fixed function and vertex programs, depth fighting can // be an issue - vertex_program_ref Ogre/BasicVertexPrograms/AmbientOneTexture + vertex_program_ref BasicVertexPrograms/AmbientOneTextureUnified { param_named_auto worldViewProj worldviewproj_matrix param_named ambient float4 1 1 1 1 Added: branches/ogsector/data/materials/advancedMaterials.material =================================================================== --- branches/ogsector/data/materials/advancedMaterials.material (rev 0) +++ branches/ogsector/data/materials/advancedMaterials.material 2007-07-28 14:21:14 UTC (rev 643) @@ -0,0 +1,195 @@ +material TausetiTile/BumpMapping +{ + + // This is the preferred technique which uses both vertex and + // fragment programs, supports coloured lights + technique + { + // Base ambient pass + pass + { + // base colours, not needed for rendering, but as information + // to lighting pass categorisation routine + ambient 1 1 1 + diffuse 0 0 0 + specular 0 0 0 0 + // Really basic vertex program + // NB we don't use fixed function here because GL does not like + // mixing fixed function and vertex programs, depth fighting can + // be an issue + vertex_program_ref BasicVertexPrograms/AmbientOneTextureUnified + { + param_named_auto worldViewProj worldviewproj_matrix + param_named_auto ambient ambient_light_colour + } + + } + // Now do the lighting pass + // NB we don't do decal texture here because this is repeated per light + pass + { + // base colours, not needed for rendering, but as information + // to lighting pass categorisation routine + ambient 0 0 0 + + // do this for each light + iteration once_per_light + + + scene_blend add + + // Vertex program reference + vertex_program_ref BumpMapVP + { + param_named_auto lightPosition light_position_object_space 0 + param_named_auto worldViewProj worldviewproj_matrix + } + + // Fragment program + fragment_program_ref BumpMapFP + { + param_named_auto lightDiffuse light_diffuse_colour 0 + } + + // Base bump map + texture_unit + { + texture tausetiTileBump.png + colour_op replace + } + // Normalisation cube map + texture_unit + { + cubic_texture nm.png combinedUVW + tex_coord_set 1 + tex_address_mode clamp + } + } + + // Decal pass + pass + { + // base colours, not needed for rendering, but as information + // to lighting pass categorisation routine + lighting off + // Really basic vertex program + // NB we don't use fixed function here because GL does not like + // mixing fixed function and vertex programs, depth fighting can + // be an issue + vertex_program_ref BasicVertexPrograms/AmbientOneTextureUnified + { + param_named_auto worldViewProj worldviewproj_matrix + param_named ambient float4 1 1 1 1 + } + scene_blend dest_colour zero + texture_unit + { + texture tausetiTile.png + } + + } + } + + // This is the fallback which cards which don't have fragment program + // support will use + // Note that it still requires vertex program support + technique + { + // Base ambient pass + pass + { + // base colours, not needed for rendering, but as information + // to lighting pass categorisation routine + ambient 1 1 1 + diffuse 0 0 0 + specular 0 0 0 0 + // Really basic vertex program + // NB we don't use fixed function here because GL does not like + // mixing fixed function and vertex programs, depth fighting can + // be an issue + vertex_program_ref BasicVertexPrograms/AmbientOneTextureUnified + { + param_named_auto worldViewProj worldviewproj_matrix + param_named_auto ambient ambient_light_colour + } + + } + // Now do the lighting pass + // NB we don't do decal texture here because this is repeated per light + pass + { + // base colours, not needed for rendering, but as information + // to lighting pass categorisation routine + ambient 0 0 0 + // do this for each light + iteration once_per_light + + + scene_blend add + + // Vertex program reference + vertex_program_ref BumpMapVP + { + param_named_auto lightPosition light_position_object_space 0 + param_named_auto worldViewProj worldviewproj_matrix + } + + // Base bump map + texture_unit + { + texture tausetiTileBump.png + colour_op replace + } + // Normalisation cube map, with dot product on bump map + texture_unit + { + cubic_texture nm.png combinedUVW + tex_coord_set 1 + tex_address_mode clamp + colour_op_ex dotproduct src_texture src_current + colour_op_multipass_fallback dest_colour zero + } + } + + // Decal pass + pass + { + lighting off + // Really basic vertex program + // NB we don't use fixed function here because GL does not like + // mixing fixed function and vertex programs, depth fighting can + // be an issue + vertex_program_ref BasicVertexPrograms/AmbientOneTextureUnified + { + param_named_auto worldViewProj worldviewproj_matrix + param_named ambient float4 1 1 1 1 + } + scene_blend dest_colour zero + texture_unit + { + texture tausetiTile.png + } + + } + + } +} + +material TausetiTile +{ + receive_shadows on + technique + { + pass + { +// ambient 0.500000 0.500000 0.500000 1.000000 +// diffuse 0.900000 0.900000 0.900000 1.000000 + emissive 0.800000 0.800000 0.800000 1.000000 + texture_unit + { + texture tausetiTile.png + } + } + } +} + Added: branches/ogsector/data/materials/advancedMaterials.program =================================================================== --- branches/ogsector/data/materials/advancedMaterials.program (rev 0) +++ branches/ogsector/data/materials/advancedMaterials.program 2007-07-28 14:21:14 UTC (rev 643) @@ -0,0 +1,76 @@ +vertex_program BumpMapVP cg +{ + source Example_BumpMapping.cg + entry_point main_vp + profiles vs_1_1 arbvp1 +} + +// Bump map fragment program, support for this is optional +fragment_program BumpMapFP cg +{ + source Example_BumpMapping.cg + entry_point main_fp + profiles vs_1_1 arbfp1 fp20 +} + +// Bump map with specular vertex program, support for this is required +vertex_program BumpMapVPSpecular cg +{ + source Example_BumpMapping.cg + entry_point specular_vp + profiles vs_1_1 arbvp1 +} + +// Bump map fragment program, support for this is optional +fragment_program BumpMapFPSpecular cg +{ + source Example_BumpMapping.cg + entry_point specular_fp + profiles vs_1_1 arbfp1 fp20 +} + +// A really basic ambient pass program, support for one texture coodinate set +vertex_program BasicVertexPrograms/AmbientOneTexture cg +{ + source Example_Basic.cg + entry_point ambientOneTexture_vp + profiles vs_1_1 arbvp1 + + default_params + { + param_named_auto worldViewProj worldviewproj_matrix + param_named_auto ambient ambient_light_colour + } + +} + +// A really basic ambient pass program, support for one texture coodinate set +vertex_program BasicVertexPrograms/AmbientOneTextureHLSL hlsl +{ + source Example_Basic.hlsl + entry_point ambientOneTexture_vp + target vs_1_1 + + default_params + { + param_named_auto worldViewProj worldviewproj_matrix + param_named_auto ambient ambient_light_colour + } +} +// A really basic ambient pass program, support for one texture coodinate set +vertex_program BasicVertexPrograms/AmbientOneTextureGLSL glsl +{ + source AmbientOneTexture.glsl + + default_params + { + param_named_auto ambient ambient_light_colour + } +} + +vertex_program BasicVertexPrograms/AmbientOneTextureUnified unified +{ + delegate BasicVertexPrograms/AmbientOneTextureGLSL + delegate BasicVertexPrograms/AmbientOneTextureHLSL + delegate BasicVertexPrograms/AmbientOneTexture +} \ No newline at end of file Added: branches/ogsector/data/textures/tausetiTile.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/tausetiTile.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/textures/tausetiTileBump.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/tausetiTileBump.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: branches/ogsector/ogre.cfg =================================================================== --- branches/ogsector/ogre.cfg 2007-07-27 16:55:08 UTC (rev 642) +++ branches/ogsector/ogre.cfg 2007-07-28 14:21:14 UTC (rev 643) @@ -1,7 +1,7 @@ Render System=OpenGL Rendering Subsystem [OpenGL Rendering Subsystem] -FSAA=0 +FSAA=6 Full Screen=No RTT Preferred Mode=FBO Video Mode=1024 x 768 Modified: branches/ogsector/resources.cfg =================================================================== --- branches/ogsector/resources.cfg 2007-07-27 16:55:08 UTC (rev 642) +++ branches/ogsector/resources.cfg 2007-07-28 14:21:14 UTC (rev 643) @@ -17,7 +17,7 @@ FileSystem=../../trunk/data/ships/quantar/storm FileSystem=../../trunk/data/ships/tauseti/lady_kickstart FileSystem=../../trunk/data/ships/squadrok/squid -FileSystem=../../trunk/data/stations/tauseti +FileSystem=../../trunk/data/stations FileSystem=../../trunk/data/misc/asteroids FileSystem=./data Modified: branches/ogsector/src/DeviceManager.cpp =================================================================== --- branches/ogsector/src/DeviceManager.cpp 2007-07-27 16:55:08 UTC (rev 642) +++ branches/ogsector/src/DeviceManager.cpp 2007-07-28 14:21:14 UTC (rev 643) @@ -41,6 +41,8 @@ gameStateRoot = NULL; avatar = NULL; languageSuffix_ = "en"; + + mapping_ = true; } DeviceManager::~DeviceManager( ) { Modified: branches/ogsector/src/DeviceManager.h =================================================================== --- branches/ogsector/src/DeviceManager.h 2007-07-27 16:55:08 UTC (rev 642) +++ branches/ogsector/src/DeviceManager.h 2007-07-28 14:21:14 UTC (rev 643) @@ -105,6 +105,9 @@ std::set < std::string > & resourcePaths() { return resourcePaths_; } + void setMappingCapability( bool mapping ) { mapping_ = mapping; } + bool mappingCapability() const { return mapping_; } + protected: LogManager * log_; @@ -114,6 +117,7 @@ std::map< int, std::string > factionIDs_; std::set < std::string > resourcePaths_; + bool mapping_; }; } //namespace OpenGate Modified: branches/ogsector/src/EntityManager.cpp =================================================================== --- branches/ogsector/src/EntityManager.cpp 2007-07-27 16:55:08 UTC (rev 642) +++ branches/ogsector/src/EntityManager.cpp 2007-07-28 14:21:14 UTC (rev 643) @@ -201,6 +201,7 @@ case 7: entity = new Shield(); break; case 8: entity = new Radar(); break; case 10: entity = new Gun(); break; + case 11: entity = new Gun(); break; default: log_->fatal( fileName + " category_id " + toStr( category ) + " unknown." ); return NULL; Modified: branches/ogsector/src/GameStateManager.cpp =================================================================== --- branches/ogsector/src/GameStateManager.cpp 2007-07-27 16:55:08 UTC (rev 642) +++ branches/ogsector/src/GameStateManager.cpp 2007-07-28 14:21:14 UTC (rev 643) @@ -345,6 +345,17 @@ if ( !initialiseOgreResources_() ) return false; + const Ogre::RenderSystemCapabilities * caps = DeviceManager::getSingleton().ogreRoot->getRenderSystem()->getCapabilities(); + + if ( !caps->hasCapability( Ogre::RSC_VERTEX_PROGRAM ) ) { + log_->warn("Your card does not support vertex programs."); + DeviceManager::getSingleton().setMappingCapability( false ); + } + if ( !( caps->hasCapability( Ogre::RSC_FRAGMENT_PROGRAM ) || caps->hasCapability( Ogre::RSC_DOT3 ) ) ) { + log_->warn("Your card does not support dot3 blending or fragment programs." ); + DeviceManager::getSingleton().setMappingCapability( false ); + } + if ( !initialiseCEGUIEngine_( ) ) return false; if ( !initialiseInputManager_() ) return false; Modified: branches/ogsector/src/Sector.cpp =================================================================== --- branches/ogsector/src/Sector.cpp 2007-07-27 16:55:08 UTC (rev 642) +++ branches/ogsector/src/Sector.cpp 2007-07-28 14:21:14 UTC (rev 643) @@ -136,43 +136,8 @@ planetNode_->setPosition( Ogre::Vector3( 20000.0, 10000.0, 50000 ) ); } - // Build tangent vectors, all our meshes use only 1 texture coordset - // Note we can build into VES_TANGENT now (SM2+) - - sceneMgr_->setAmbientLight( Ogre::ColourValue( 0.0, 0.0, 0.0 ) ); - - const Ogre::RenderSystemCapabilities * caps = DeviceManager::getSingleton().ogreRoot->getRenderSystem()->getCapabilities(); - bool mapping = true; - if ( !caps->hasCapability( Ogre::RSC_VERTEX_PROGRAM ) ) { - log_->warn("Your card does not support vertex programs."); - mapping = false; - } - if ( !( caps->hasCapability( Ogre::RSC_FRAGMENT_PROGRAM ) || caps->hasCapability( Ogre::RSC_DOT3 ) ) ) { - log_->warn("Your card does not support dot3 blending or fragment programs." ); - mapping = false; - } - - Ogre::MeshPtr pMesh = Ogre::MeshManager::getSingleton().load( "asteroid01.mesh", - Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, - Ogre::HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY, - Ogre::HardwareBuffer::HBU_STATIC_WRITE_ONLY, - true, true); - unsigned short src, dest; - if ( !pMesh->suggestTangentVectorBuildParams( Ogre::VES_TANGENT, src, dest) ) { - pMesh->buildTangentVectors( Ogre::VES_TANGENT, src, dest); - } - - SectorObject *a1 = createStaticObject( "asteroid01.mesh", "astro with bump", Ogre::Vector3( -250, 0, 440 ) ); - a1->mainNode()->scale( 20, 20, 20 ); - - SectorObject *a2 = createStaticObject( "asteroid01.mesh", "astro without bump", Ogre::Vector3( -250, 0, 500 ) ); - a2->mainNode()->scale( 20, 20, 20 ); - - if ( mapping ) a1->entity()->setMaterialName("Asteroid/BumpMapping"); - else { a1->entity()->setMaterialName("Asteroid"); } - a2->entity()->setMaterialName("Asteroid"); - - + sceneMgr_->setAmbientLight( Ogre::ColourValue( 0.2, 0.2, 0.2 ) ); + populate( "testsector.xml" ); // createCircle(); @@ -296,6 +261,17 @@ pSubElem = pElem->FirstChildElement( "mesh" ); if ( pSubElem ){ mesh = std::string( pSubElem->FirstChild()->Value() ) + ".mesh"; + + Ogre::MeshPtr pMesh = Ogre::MeshManager::getSingleton().load( mesh, + Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, + Ogre::HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY, + Ogre::HardwareBuffer::HBU_STATIC_WRITE_ONLY, + true, true); + unsigned short src, dest; + if ( !pMesh->suggestTangentVectorBuildParams( Ogre::VES_TANGENT, src, dest) ) { + pMesh->buildTangentVectors( Ogre::VES_TANGENT, src, dest); + } + } else { log_->warn( "missing mesh for sectorobject " + name ); continue; @@ -328,6 +304,12 @@ size = toVector3( pSubElem->FirstChild()->Value(), ',' ); } + std::string material; + pSubElem = pElem->FirstChildElement( "material" ); + if ( pSubElem ){ + material = pSubElem->FirstChild()->Value(); + } + SectorObject * obj = createStaticObject( mesh, name, pos ); if ( size.length() > 0 ) { obj->setBaseSize( size ); @@ -335,6 +317,14 @@ obj->scale( scale ); } + if ( material.size() > 0 ) { + if ( ! DeviceManager::getSingleton().mappingCapability() ){ + obj->entity()->setMaterialName( material.substr( 0, material.rfind("/BumpMapping") ) ); + } else { + obj->entity()->setMaterialName( material ); + } + } + if ( direction.length() > 0 ){ obj->mainNode()->lookAt( Ogre::Vector3( obj->mainNode()->getPosition() * direction), Ogre::Node::TS_WORLD ); } Modified: trunk/data/misc/testsector.xml =================================================================== --- trunk/data/misc/testsector.xml 2007-07-27 16:55:08 UTC (rev 642) +++ trunk/data/misc/testsector.xml 2007-07-28 14:21:14 UTC (rev 643) @@ -5,7 +5,7 @@ <skybox>OpenGate/SimpleSkyBox3</skybox> <!-- show all vessels --> - <vesselschool>all</vesselschool> +<!-- <vesselschool>all</vesselschool> --> <!-- <sectorobject> --> <!-- Mandatory --> @@ -16,96 +16,118 @@ <!-- <size>desired size of this object</size> --> <!-- <scale>scaling factor for the ogre mesh</size> --> <!-- <direction>desired front direction</direction> --> +<!-- <texture>desired front direction</texture> --> <!-- </sectorobject> --> <sectorobject> - <name>ogreheadStation1</name> - <mesh>ogrehead</mesh> - <position>5000.0, 1000.0, 0.0</position> - <size>500, 500, 500</size> + <name>tauseti wake</name> + <mesh>tauseti_wake</mesh> + <position>1000.0, 0.0, -200.0</position> + <scale>100, 100, 100</scale> + <material>TausetiTile/BumpMapping</material> </sectorobject> <sectorobject> - <name>ogrehead1</name> - <mesh>ogrehead</mesh> - <position>100,0,0</position> - <size>10, 10, 10</size> - <direction>1,0,0</direction> + <name>astro with bump</name> + <mesh>asteroid01</mesh> + <position> -250, 0, 440</position> + <scale>20, 20, 20</scale> + <material>Asteroid/BumpMapping</material> </sectorobject> <sectorobject> - <name>ogrehead2</name> - <mesh>ogrehead</mesh> - <position>-100.0, 0, 0.0</position> - <size>10, 10, 10</size> - <direction>1,0,0</direction> + <name>astro without bump</name> + <mesh>asteroid01</mesh> + <position> -250, 0, 500</position> + <scale>20, 20, 20</scale> + <material>Asteroid</material> </sectorobject> - <sectorobject> - <name>astro6</name> - <mesh>ice_oval_6</mesh> - <position>0.0, -10, 0.0</position> - <scale>3, 3, 3</scale> - <direction>0,0,1</direction> - </sectorobject> - <sectorobject> - <name>astro7</name> - <mesh>ice_oval_7</mesh> - <position>10.0, 0, 0.0</position> - <scale>3, 3, 3</scale> - <direction>0,0,1</direction> - </sectorobject> - <sectorobject> - <name>astro8</name> - <mesh>ice_oval_8</mesh> - <position>20.0, 0, 0.0</position> - <scale>3, 3, 3</scale> - <direction>0,0,1</direction> - </sectorobject> - <sectorobject> - <name>astro9</name> - <mesh>ice_oval_9</mesh> - <position>30.0, 0, 0.0</position> - <scale>3, 3, 3</scale> - <direction>0,0,1</direction> - </sectorobject> - <sectorobject> - <name>astro10</name> - <mesh>ice_oval_10</mesh> - <position>40.0, 0, 0.0</position> - <scale>1, 1, 1</scale> - <direction>0,0,1</direction> - </sectorobject> - <sectorobject> - <name>astro1</name> - <mesh>normal_oval_1</mesh> - <position>0.0, 10, 0.0</position> - <scale>3, 3, 3</scale> - <direction>0,0,1</direction> - </sectorobject> - <sectorobject> - <name>astro2</name> - <mesh>normal_oval_2</mesh> - <position>10.0, 10, 0.0</position> - <scale>4, 4, 4</scale> - <direction>0,0,1</direction> - </sectorobject> - <sectorobject> - <name>astro3</name> - <mesh>normal_oval_3</mesh> - <position>20.0, 10, 0.0</position> - <scale>3, 3, 3</scale> - <direction>0,0,1</direction> - </sectorobject> - <sectorobject> - <name>astro4</name> - <mesh>normal_oval_4</mesh> - <position>30.0, 10, 0.0</position> - <scale>3, 3, 3</scale> - <direction>0,0,1</direction> - </sectorobject> - <sectorobject> - <name>astro5</name> - <mesh>normal_oval_5</mesh> - <position>40.0, 10, 0.0</position> - <scale>1, 1, 1</scale> - <direction>0,0,1</direction> - </sectorobject> +<!-- <sectorobject> --> +<!-- <name>ogreheadStation1</name> --> +<!-- <mesh>ogrehead</mesh> --> +<!-- <position>5000.0, 1000.0, 0.0</position> --> +<!-- <size>500, 500, 500</size> --> +<!-- </sectorobject> --> +<!-- <sectorobject> --> +<!-- <name>ogrehead1</name> --> +<!-- <mesh>ogrehead</mesh> --> +<!-- <position>100,0,0</position> --> +<!-- <size>10, 10, 10</size> --> +<!-- <direction>1,0,0</direction> --> +<!-- </sectorobject> --> +<!-- <sectorobject> --> +<!-- <name>ogrehead2</name> --> +<!-- <mesh>ogrehead</mesh> --> +<!-- <position>-100.0, 0, 0.0</position> --> +<!-- <size>10, 10, 10</size> --> +<!-- <direction>1,0,0</direction> --> +<!-- </sectorobject> --> +<!-- <sectorobject> --> +<!-- <name>astro6</name> --> +<!-- <mesh>ice_oval_6</mesh> --> +<!-- <position>0.0, -10, 0.0</position> --> +<!-- <scale>3, 3, 3</scale> --> +<!-- <direction>0,0,1</direction> --> +<!-- </sectorobject> --> +<!-- <sectorobject> --> +<!-- <name>astro7</name> --> +<!-- <mesh>ice_oval_7</mesh> --> +<!-- <position>10.0, 0, 0.0</position> --> +<!-- <scale>3, 3, 3</scale> --> +<!-- <direction>0,0,1</direction> --> +<!-- </sectorobject> --> +<!-- <sectorobject> --> +<!-- <name>astro8</name> --> +<!-- <mesh>ice_oval_8</mesh> --> +<!-- <position>20.0, 0, 0.0</position> --> +<!-- <scale>3, 3, 3</scale> --> +<!-- <direction>0,0,1</direction> --> +<!-- </sectorobject> --> +<!-- <sectorobject> --> +<!-- <name>astro9</name> --> +<!-- <mesh>ice_oval_9</mesh> --> +<!-- <position>30.0, 0, 0.0</position> --> +<!-- <scale>3, 3, 3</scale> --> +<!-- <direction>0,0,1</direction> --> +<!-- </sectorobject> --> +<!-- <sectorobject> --> +<!-- <name>astro10</name> --> +<!-- <mesh>ice_oval_10</mesh> --> +<!-- <position>40.0, 0, 0.0</position> --> +<!-- <scale>1, 1, 1</scale> --> +<!-- <direction>0,0,1</direction> --> +<!-- </sectorobject> --> +<!-- <sectorobject> --> +<!-- <name>astro1</name> --> +<!-- <mesh>normal_oval_1</mesh> --> +<!-- <position>0.0, 10, 0.0</position> --> +<!-- <scale>3, 3, 3</scale> --> +<!-- <direction>0,0,1</direction> --> +<!-- </sectorobject> --> +<!-- <sectorobject> --> +<!-- <name>astro2</name> --> +<!-- <mesh>normal_oval_2</mesh> --> +<!-- <position>10.0, 10, 0.0</position> --> +<!-- <scale>4, 4, 4</scale> --> +<!-- <direction>0,0,1</direction> --> +<!-- </sectorobject> --> +<!-- <sectorobject> --> +<!-- <name>astro3</name> --> +<!-- <mesh>normal_oval_3</mesh> --> +<!-- <position>20.0, 10, 0.0</position> --> +<!-- <scale>3, 3, 3</scale> --> +<!-- <direction>0,0,1</direction> --> +<!-- </sectorobject> --> +<!-- <sectorobject> --> +<!-- <name>astro4</name> --> +<!-- <mesh>normal_oval_4</mesh> --> +<!-- <position>30.0, 10, 0.0</position> --> +<!-- <scale>3, 3, 3</scale> --> +<!-- <direction>0,0,1</direction> --> +<!-- </sectorobject> --> +<!-- <sectorobject> --> +<!-- <name>astro5</name> --> +<!-- <mesh>normal_oval_5</mesh> --> +<!-- <position>40.0, 10, 0.0</position> --> +<!-- <scale>1, 1, 1</scale> --> +<!-- <direction>0,0,1</direction> --> +<!-- </sectorobject> --> </sector> Added: trunk/data/stations/tauseti_wake.mesh =================================================================== (Binary files differ) Property changes on: trunk/data/stations/tauseti_wake.mesh ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2007-07-30 19:58:06
|
Revision: 648 http://opengate.svn.sourceforge.net/opengate/?rev=648&view=rev Author: spom_spom Date: 2007-07-30 12:58:06 -0700 (Mon, 30 Jul 2007) Log Message: ----------- Add: very basic station texture for testing purposes Modified Paths: -------------- branches/ogsector/data/materials/advancedMaterials.material branches/ogsector/src/OpcodeWrapper.cpp branches/ogsector/src/Sector.cpp trunk/data/misc/testsector.xml trunk/data/stations/tauseti_wake.blend trunk/data/stations/tauseti_wake.mesh Added Paths: ----------- branches/ogsector/data/materials/station.material branches/ogsector/data/textures/stationTileBackground.png branches/ogsector/data/textures/stationTileBackgroundBump.png branches/ogsector/data/textures/stationTileIconBump.png branches/ogsector/data/textures/stationTube.png branches/ogsector/data/textures/stationTubePad.png trunk/data/stations/tauseti_wake_2.blend Modified: branches/ogsector/data/materials/advancedMaterials.material =================================================================== --- branches/ogsector/data/materials/advancedMaterials.material 2007-07-28 20:27:12 UTC (rev 647) +++ branches/ogsector/data/materials/advancedMaterials.material 2007-07-30 19:58:06 UTC (rev 648) @@ -1,4 +1,4 @@ -material TausetiTile/BumpMapping +material StationTileBackground/BumpMapping { // This is the preferred technique which uses both vertex and @@ -54,7 +54,7 @@ // Base bump map texture_unit { - texture tausetiTileBump.png + texture stationTileBackgroundBump.png colour_op replace } // Normalisation cube map @@ -84,7 +84,7 @@ scene_blend dest_colour zero texture_unit { - texture tausetiTile.png + texture stationTileBackground.png } } @@ -137,7 +137,7 @@ // Base bump map texture_unit { - texture tausetiTileBump.png + texture stationTileBackgroundBump.png colour_op replace } // Normalisation cube map, with dot product on bump map @@ -167,7 +167,7 @@ scene_blend dest_colour zero texture_unit { - texture tausetiTile.png + texture stationTileBackground.png } } @@ -175,15 +175,192 @@ } } -material TausetiTile +material StationTileIcon/BumpMapping +{ + + // This is the preferred technique which uses both vertex and + // fragment programs, supports coloured lights + technique + { + // Base ambient pass + pass + { + // base colours, not needed for rendering, but as information + // to lighting pass categorisation routine + ambient 1 1 1 + diffuse 0 0 0 + specular 0 0 0 0 + // Really basic vertex program + // NB we don't use fixed function here because GL does not like + // mixing fixed function and vertex programs, depth fighting can + // be an issue + vertex_program_ref BasicVertexPrograms/AmbientOneTextureUnified + { + param_named_auto worldViewProj worldviewproj_matrix + param_named_auto ambient ambient_light_colour + } + + } + // Now do the lighting pass + // NB we don't do decal texture here because this is repeated per light + pass + { + // base colours, not needed for rendering, but as information + // to lighting pass categorisation routine + ambient 0 0 0 + + // do this for each light + iteration once_per_light + + + scene_blend add + + // Vertex program reference + vertex_program_ref BumpMapVP + { + param_named_auto lightPosition light_position_object_space 0 + param_named_auto worldViewProj worldviewproj_matrix + } + + // Fragment program + fragment_program_ref BumpMapFP + { + param_named_auto lightDiffuse light_diffuse_colour 0 + } + + // Base bump map + texture_unit + { + texture stationTileIconBump.png + colour_op replace + } + // Normalisation cube map + texture_unit + { + cubic_texture nm.png combinedUVW + tex_coord_set 1 + tex_address_mode clamp + } + } + + // Decal pass + pass + { + // base colours, not needed for rendering, but as information + // to lighting pass categorisation routine + lighting off + // Really basic vertex program + // NB we don't use fixed function here because GL does not like + // mixing fixed function and vertex programs, depth fighting can + // be an issue + vertex_program_ref BasicVertexPrograms/AmbientOneTextureUnified + { + param_named_auto worldViewProj worldviewproj_matrix + param_named ambient float4 1 1 1 1 + } + scene_blend dest_colour zero + texture_unit + { + texture stationTileBackground.png + } + + } + } + + // This is the fallback which cards which don't have fragment program + // support will use + // Note that it still requires vertex program support + technique + { + // Base ambient pass + pass + { + // base colours, not needed for rendering, but as information + // to lighting pass categorisation routine + ambient 1 1 1 + diffuse 0 0 0 + specular 0 0 0 0 + // Really basic vertex program + // NB we don't use fixed function here because GL does not like + // mixing fixed function and vertex programs, depth fighting can + // be an issue + vertex_program_ref BasicVertexPrograms/AmbientOneTextureUnified + { + param_named_auto worldViewProj worldviewproj_matrix + param_named_auto ambient ambient_light_colour + } + + } + // Now do the lighting pass + // NB we don't do decal texture here because this is repeated per light + pass + { + // base colours, not needed for rendering, but as information + // to lighting pass categorisation routine + ambient 0 0 0 + // do this for each light + iteration once_per_light + + + scene_blend add + + // Vertex program reference + vertex_program_ref BumpMapVP + { + param_named_auto lightPosition light_position_object_space 0 + param_named_auto worldViewProj worldviewproj_matrix + } + + // Base bump map + texture_unit + { + texture stationTileIconBump.png + colour_op replace + } + // Normalisation cube map, with dot product on bump map + texture_unit + { + cubic_texture nm.png combinedUVW + tex_coord_set 1 + tex_address_mode clamp + colour_op_ex dotproduct src_texture src_current + colour_op_multipass_fallback dest_colour zero + } + } + + // Decal pass + pass + { + lighting off + // Really basic vertex program + // NB we don't use fixed function here because GL does not like + // mixing fixed function and vertex programs, depth fighting can + // be an issue + vertex_program_ref BasicVertexPrograms/AmbientOneTextureUnified + { + param_named_auto worldViewProj worldviewproj_matrix + param_named ambient float4 1 1 1 1 + } + scene_blend dest_colour zero + texture_unit + { + texture stationTileBackground.png + } + + } + + } +} + +material StationTile { receive_shadows on technique { pass { -// ambient 0.500000 0.500000 0.500000 1.000000 -// diffuse 0.900000 0.900000 0.900000 1.000000 + ambient 0.500000 0.500000 0.500000 1.000000 + diffuse 0.900000 0.900000 0.900000 1.000000 emissive 0.800000 0.800000 0.800000 1.000000 texture_unit { Added: branches/ogsector/data/materials/station.material =================================================================== --- branches/ogsector/data/materials/station.material (rev 0) +++ branches/ogsector/data/materials/station.material 2007-07-30 19:58:06 UTC (rev 648) @@ -0,0 +1,89 @@ +material Station/Background +{ + receive_shadows on + technique + { + pass + { + ambient 0.500000 0.500000 0.500000 1.000000 + diffuse 0.900000 0.900000 0.900000 1.000000 + emissive 0.800000 0.800000 0.800000 1.000000 + texture_unit + { + texture stationTileBackground.png + } + } + } +} + +material Station/Tube +{ + receive_shadows on + technique + { + pass + { + ambient 0.500000 0.500000 0.500000 1.000000 + diffuse 0.900000 0.900000 0.900000 1.000000 + emissive 0.800000 0.800000 0.800000 1.000000 + texture_unit + { + texture stationTube.png + } + } + } +} + +material Station/Logo +{ + receive_shadows on + technique + { + pass + { + ambient 0.500000 0.500000 0.500000 1.000000 + diffuse 0.900000 0.900000 0.900000 1.000000 + emissive 0.800000 0.800000 0.800000 1.000000 + texture_unit + { + texture stationTileBackground.png + } + } + } +} + +material Station/DockPad +{ + receive_shadows on + technique + { + pass + { + ambient 0.500000 0.500000 0.500000 1.000000 + diffuse 0.900000 0.900000 0.900000 1.000000 + emissive 0.800000 0.800000 0.800000 1.000000 + texture_unit + { + texture stationTubePad.png + } + } + } +} + +material Station/LaunchPad +{ + receive_shadows on + technique + { + pass + { + ambient 0.500000 0.500000 0.500000 1.000000 + diffuse 0.900000 0.900000 0.900000 1.000000 + emissive 0.800000 0.800000 0.800000 1.000000 + texture_unit + { + texture stationTubePad.png + } + } + } +} Added: branches/ogsector/data/textures/stationTileBackground.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/stationTileBackground.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/textures/stationTileBackgroundBump.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/stationTileBackgroundBump.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/textures/stationTileIconBump.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/stationTileIconBump.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/textures/stationTube.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/stationTube.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: branches/ogsector/data/textures/stationTubePad.png =================================================================== (Binary files differ) Property changes on: branches/ogsector/data/textures/stationTubePad.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: branches/ogsector/src/OpcodeWrapper.cpp =================================================================== --- branches/ogsector/src/OpcodeWrapper.cpp 2007-07-28 20:27:12 UTC (rev 647) +++ branches/ogsector/src/OpcodeWrapper.cpp 2007-07-30 19:58:06 UTC (rev 648) @@ -41,7 +41,8 @@ OgreOpcode::CollisionManager::getSingletonPtr()->addCollType( "Bullet", "Bullet", OgreOpcode::COLLTYPE_IGNORE ); OgreOpcode::CollisionManager::getSingletonPtr()->addCollType( "SectorObject", "Bullet", OgreOpcode::COLLTYPE_EXACT ); - OgreOpcode::CollisionManager::getSingletonPtr()->addCollType( "SectorObject", "SectorObject", OgreOpcode::COLLTYPE_CONTACT ); + OgreOpcode::CollisionManager::getSingletonPtr()->addCollType( "SectorObject", "SectorObject", OgreOpcode::COLLTYPE_EXACT ); +// OgreOpcode::CollisionManager::getSingletonPtr()->addCollType( "SectorObject", "SectorObject", OgreOpcode::COLLTYPE_CONTACT ); // OgreOpcode::CollisionManager::getSingletonPtr()->addCollType( "SectorObject", "SectorObject", OgreOpcode::COLLTYPE_QUICK ); collideInSectorContext_ = OgreOpcode::CollisionManager::getSingletonPtr()->getDefaultContext(); Modified: branches/ogsector/src/Sector.cpp =================================================================== --- branches/ogsector/src/Sector.cpp 2007-07-28 20:27:12 UTC (rev 647) +++ branches/ogsector/src/Sector.cpp 2007-07-30 19:58:06 UTC (rev 648) @@ -34,6 +34,7 @@ #include <OgreRenderSystemCapabilities.h> #include <OgreRenderSystem.h> #include <OgreMesh.h> +#include <OgreSubEntity.h> #include <OgreMeshManager.h> @@ -138,6 +139,41 @@ sceneMgr_->setAmbientLight( Ogre::ColourValue( 0.2, 0.2, 0.2 ) ); + + Ogre::MeshPtr pMesh = Ogre::MeshManager::getSingleton().load( "tauseti_wake.mesh", + Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, + Ogre::HardwareBuffer::HBU_DYNAMIC_WRITE_ONLY, + Ogre::HardwareBuffer::HBU_STATIC_WRITE_ONLY, + true, true); + + unsigned short src, dest; + + if ( !pMesh->suggestTangentVectorBuildParams( Ogre::VES_TANGENT, src, dest) ) { + pMesh->buildTangentVectors( Ogre::VES_TANGENT, src, dest); + } + SectorObject *obj = createStaticObject("tauseti_wake.mesh", "ogrehead", Ogre::Vector3( 0.0, 0.0, 100 ) ); + +// pMesh->getSubMesh( 1 )->setMaterialName("Asteroid/BumpMapping"); + +// pMesh->getSubMesh( 1 )->updateMaterialUsingTextureAliases(); + + + std::cout << "subentitynames:" << std::endl; + + for ( int i = 0; i < obj->entity()->getNumSubEntities(); i ++ ){ + // std::cout << pMesh->getSubMesh( i )->getName() << std::endl; + std::cout << obj->entity()->getSubEntity( i )->getMaterialName() << std::endl; + } + + if ( DeviceManager::getSingleton().mappingCapability() ){ + obj->entity()->getSubEntity( 0 )->setMaterialName("StationTileBackground/BumpMapping"); + obj->entity()->getSubEntity( 1 )->setMaterialName("StationTileIcon/BumpMapping"); + } + obj->mainNode()->scale(50, 50, 50 ); + obj->mainNode()->setPosition( 1000.0, 0.0, -200.0 ); + + + populate( "testsector.xml" ); // createCircle(); Modified: trunk/data/misc/testsector.xml =================================================================== --- trunk/data/misc/testsector.xml 2007-07-28 20:27:12 UTC (rev 647) +++ trunk/data/misc/testsector.xml 2007-07-30 19:58:06 UTC (rev 648) @@ -19,14 +19,14 @@ <!-- <texture>desired front direction</texture> --> <!-- </sectorobject> --> +<!-- <sectorobject> --> +<!-- <name>tauseti wake</name> --> +<!-- <mesh>tauseti_wake</mesh> --> +<!-- <position>1000.0, 0.0, -200.0</position> --> +<!-- <scale>100, 100, 100</scale> --> +<!-- <material>TausetiTile/BumpMapping</material> --> +<!-- </sectorobject> --> <sectorobject> - <name>tauseti wake</name> - <mesh>tauseti_wake</mesh> - <position>1000.0, 0.0, -200.0</position> - <scale>100, 100, 100</scale> - <material>TausetiTile/BumpMapping</material> - </sectorobject> - <sectorobject> <name>astro with bump</name> <mesh>asteroid01</mesh> <position> -250, 0, 440</position> Modified: trunk/data/stations/tauseti_wake.blend =================================================================== (Binary files differ) Modified: trunk/data/stations/tauseti_wake.mesh =================================================================== (Binary files differ) Added: trunk/data/stations/tauseti_wake_2.blend =================================================================== (Binary files differ) Property changes on: trunk/data/stations/tauseti_wake_2.blend ___________________________________________________________________ Name: svn:mime-type + application/octet-stream This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <spo...@us...> - 2007-08-05 21:45:07
|
Revision: 652 http://opengate.svn.sourceforge.net/opengate/?rev=652&view=rev Author: spom_spom Date: 2007-08-05 14:45:05 -0700 (Sun, 05 Aug 2007) Log Message: ----------- Add the docking capability for stations. Modified Paths: -------------- branches/ogsector/src/BaseDialog.cpp branches/ogsector/src/BaseDialog.h branches/ogsector/src/ConfigDialog.cpp branches/ogsector/src/Console.cpp branches/ogsector/src/Console.h branches/ogsector/src/DockedState.cpp branches/ogsector/src/Entity.cpp branches/ogsector/src/Entity.h branches/ogsector/src/EntityManager.cpp branches/ogsector/src/GameState.h branches/ogsector/src/GameStateManager.cpp branches/ogsector/src/GameStateManager.h branches/ogsector/src/Makefile.am branches/ogsector/src/Makefile.in branches/ogsector/src/MarketDialog.cpp branches/ogsector/src/OpcodeWrapper.cpp branches/ogsector/src/OpcodeWrapper.h branches/ogsector/src/Sector.cpp branches/ogsector/src/Sector.h branches/ogsector/src/SectorObjects.cpp branches/ogsector/src/SectorObjects.h branches/ogsector/src/ShipConfigDialog.cpp branches/ogsector/src/UnDockedState.cpp branches/ogsector/src/Vessel.cpp branches/ogsector/src/Vessel.h branches/ogsector/src/VesselManager.cpp branches/ogsector/src/common.h trunk/data/misc/testsector.xml trunk/data/stations/tauseti_wake.mesh trunk/data/stations/tauseti_wake.xml trunk/data/stations/tauseti_wake_2.blend Added Paths: ----------- branches/ogsector/doc/ branches/ogsector/doc/Doxyfile branches/ogsector/src/ResourceManager.cpp branches/ogsector/src/ResourceManager.h branches/ogsector/src/Station.cpp branches/ogsector/src/Station.h Removed Paths: ------------- branches/ogsector/Doxyfile branches/ogsector/src/DeviceManager.cpp branches/ogsector/src/DeviceManager.h Deleted: branches/ogsector/Doxyfile =================================================================== --- branches/ogsector/Doxyfile 2007-08-02 23:02:18 UTC (rev 651) +++ branches/ogsector/Doxyfile 2007-08-05 21:45:05 UTC (rev 652) @@ -1,277 +0,0 @@ -# Doxyfile 1.5.2 - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -DOXYFILE_ENCODING = UTF-8 -PROJECT_NAME = opengate -PROJECT_NUMBER = 0.0.1 -OUTPUT_DIRECTORY = /home/cbrill/source/opengate/branches/ogsector/doc/ -CREATE_SUBDIRS = NO -OUTPUT_LANGUAGE = English -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = YES -STRIP_FROM_PATH = /home/cbrill/ -STRIP_FROM_INC_PATH = -SHORT_NAMES = NO -JAVADOC_AUTOBRIEF = NO -MULTILINE_CPP_IS_BRIEF = NO -DETAILS_AT_TOP = NO -INHERIT_DOCS = YES -SEPARATE_MEMBER_PAGES = NO -TAB_SIZE = 8 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = NO -OPTIMIZE_OUTPUT_JAVA = NO -BUILTIN_STL_SUPPORT = NO -CPP_CLI_SUPPORT = NO -DISTRIBUTE_GROUP_DOC = NO -SUBGROUPING = YES -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- -EXTRACT_ALL = NO -EXTRACT_PRIVATE = YES -EXTRACT_STATIC = YES -EXTRACT_LOCAL_CLASSES = YES -EXTRACT_LOCAL_METHODS = NO -HIDE_UNDOC_MEMBERS = YES -HIDE_UNDOC_CLASSES = YES -HIDE_FRIEND_COMPOUNDS = NO -HIDE_IN_BODY_DOCS = NO -INTERNAL_DOCS = NO -CASE_SENSE_NAMES = YES -HIDE_SCOPE_NAMES = NO -SHOW_INCLUDE_FILES = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = YES -SORT_BRIEF_DOCS = NO -SORT_BY_SCOPE_NAME = NO -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -SHOW_USED_FILES = YES -SHOW_DIRECTORIES = NO -FILE_VERSION_FILTER = -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_IF_DOC_ERROR = YES -WARN_NO_PARAMDOC = NO -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = /home/cbrill/source/opengate/branches/ogsector/src/ -INPUT_ENCODING = UTF-8 -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.d \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.idl \ - *.odl \ - *.cs \ - *.php \ - *.php3 \ - *.inc \ - *.m \ - *.mm \ - *.dox \ - *.py \ - *.C \ - *.CC \ - *.C++ \ - *.II \ - *.I++ \ - *.H \ - *.HH \ - *.H++ \ - *.CS \ - *.PHP \ - *.PHP3 \ - *.M \ - *.MM \ - *.PY -RECURSIVE = YES -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXCLUDE_SYMBOLS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = * -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = -FILTER_SOURCE_FILES = NO -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = NO -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = NO -REFERENCES_RELATION = NO -REFERENCES_LINK_SOURCE = YES -USE_HTAGS = NO -VERBATIM_HEADERS = NO -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = NO -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -BINARY_TOC = NO -TOC_EXPAND = NO -DISABLE_INDEX = NO -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = NO -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = NO -USE_PDFLATEX = NO -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = rtf -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = NO -XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = -XML_PROGRAMLISTING = YES -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = NO -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = NO -MSCGEN_PATH = -HIDE_UNDOC_RELATIONS = YES -HAVE_DOT = NO -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -GROUP_GRAPHS = YES -UML_LOOK = NO -TEMPLATE_RELATIONS = NO -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -CALL_GRAPH = NO -CALLER_GRAPH = NO -GRAPHICAL_HIERARCHY = YES -DIRECTORY_GRAPH = YES -DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = -DOT_GRAPH_MAX_NODES = 50 -DOT_TRANSPARENT = NO -DOT_MULTI_TARGETS = NO -GENERATE_LEGEND = YES -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO Added: branches/ogsector/doc/Doxyfile =================================================================== --- branches/ogsector/doc/Doxyfile (rev 0) +++ branches/ogsector/doc/Doxyfile 2007-08-05 21:45:05 UTC (rev 652) @@ -0,0 +1,277 @@ +# Doxyfile 1.5.2 + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = opengate +PROJECT_NUMBER = 0.0.1 +OUTPUT_DIRECTORY = ./ +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = NO +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +BUILTIN_STL_SUPPORT = NO +CPP_CLI_SUPPORT = NO +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = YES +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = YES +EXTRACT_PRIVATE = YES +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = YES +HIDE_UNDOC_MEMBERS = YES +HIDE_UNDOC_CLASSES = YES +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = YES +SORT_BRIEF_DOCS = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = NO +FILE_VERSION_FILTER = +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text" +WARN_LOGFILE = +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = ../src/ +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.d \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.m \ + *.mm \ + *.dox \ + *.py \ + *.C \ + *.CC \ + *.C++ \ + *.II \ + *.I++ \ + *.H \ + *.HH \ + *.H++ \ + *.CS \ + *.PHP \ + *.PHP3 \ + *.M \ + *.MM \ + *.PY +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = +EXAMPLE_PATTERNS = * +EXAMPLE_RECURSIVE = NO +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = NO +INLINE_SOURCES = NO +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = NO +REFERENCES_RELATION = NO +REFERENCES_LINK_SOURCE = YES +USE_HTAGS = NO +VERBATIM_HEADERS = NO +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = NO +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +MSCGEN_PATH = +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = YES +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = NO +TEMPLATE_RELATIONS = NO +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = png +DOT_PATH = +DOTFILE_DIRS = +DOT_GRAPH_MAX_NODES = 50 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +# Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = NO Modified: branches/ogsector/src/BaseDialog.cpp =================================================================== --- branches/ogsector/src/BaseDialog.cpp 2007-08-02 23:02:18 UTC (rev 651) +++ branches/ogsector/src/BaseDialog.cpp 2007-08-05 21:45:05 UTC (rev 652) @@ -19,7 +19,7 @@ ***************************************************************************/ #include "BaseDialog.h" -#include "DeviceManager.h" +#include "ResourceManager.h" #include <OgreRenderWindow.h> @@ -40,24 +40,24 @@ float windowHeight( const CEGUI::Window * child ){ if ( child->getParent() ) return child->getHeight().asAbsolute( windowHeight( child->getParent() ) ); - return child->getHeight().asAbsolute( DeviceManager::getSingleton().renderWindow->getHeight() ); + return child->getHeight().asAbsolute( ResourceManager::getSingleton().renderWindow->getHeight() ); } float windowWidth( const CEGUI::Window * child ){ if ( child->getParent() ) return child->getWidth().asAbsolute( windowWidth( child->getParent() ) ); - return child->getWidth().asAbsolute( DeviceManager::getSingleton().renderWindow->getWidth() ); + return child->getWidth().asAbsolute( ResourceManager::getSingleton().renderWindow->getWidth() ); } BaseDialog::BaseDialog( const std::string & layout ) : rootWindow_( CEGUI::WindowManager::getSingleton().loadWindowLayout( layout ) ), - devices_( DeviceManager::getSingletonPtr() ), visible_( false ) { + resources_( ResourceManager::getSingletonPtr() ), visible_( false ) { hide(); } BaseDialog::~BaseDialog(){ - if ( devices_->guiSystem ){ - if ( devices_->guiSystem->getGUISheet() ){ - devices_->guiSystem->getGUISheet()->removeChildWindow( rootWindow_ ); + if ( resources_->guiSystem ){ + if ( resources_->guiSystem->getGUISheet() ){ + resources_->guiSystem->getGUISheet()->removeChildWindow( rootWindow_ ); } } CEGUI::WindowManager::getSingleton().destroyWindow( rootWindow_ ); Modified: branches/ogsector/src/BaseDialog.h =================================================================== --- branches/ogsector/src/BaseDialog.h 2007-08-02 23:02:18 UTC (rev 651) +++ branches/ogsector/src/BaseDialog.h 2007-08-05 21:45:05 UTC (rev 652) @@ -70,7 +70,7 @@ protected: CEGUI::Window * rootWindow_; - DeviceManager * devices_; + ResourceManager * resources_; bool visible_; Modified: branches/ogsector/src/ConfigDialog.cpp =================================================================== --- branches/ogsector/src/ConfigDialog.cpp 2007-08-02 23:02:18 UTC (rev 651) +++ branches/ogsector/src/ConfigDialog.cpp 2007-08-05 21:45:05 UTC (rev 652) @@ -55,12 +55,12 @@ } bool ConfigDialog::handleQuitButton( const CEGUI::EventArgs & e ){ - devices_->gameStateRoot->shutdown(); + resources_->gameStateRoot->shutdown(); return true; } void ConfigDialog::fillCreditsWindow( ){ - std::string fileName = devices_->findFullFileName( "credits.txt" ); + std::string fileName = resources_->findFullFileName( "credits.txt" ); std::fstream file; file.open( fileName.c_str() ); Modified: branches/ogsector/src/Console.cpp =================================================================== --- branches/ogsector/src/Console.cpp 2007-08-02 23:02:18 UTC (rev 651) +++ branches/ogsector/src/Console.cpp 2007-08-05 21:45:05 UTC (rev 652) @@ -19,7 +19,7 @@ ***************************************************************************/ #include "common.h" -#include "DeviceManager.h" +#include "ResourceManager.h" #include "Console.h" #include "LogManager.h" #include "networkClient.h" @@ -32,7 +32,7 @@ Console::Console( ) : rootWindow_( CEGUI::WindowManager::getSingleton().loadWindowLayout( "opengateConsole.layout" ) ), - devices_( DeviceManager::getSingletonPtr() ) { + resources_( ResourceManager::getSingletonPtr() ) { consoleLineLength_ = 95; @@ -60,9 +60,9 @@ } void Console::start( ){ - if ( devices_->guiSystem ){ - if ( devices_->guiSystem->getGUISheet() ){ - devices_->guiSystem->getGUISheet()->addChildWindow( rootWindow_ ); + if ( resources_->guiSystem ){ + if ( resources_->guiSystem->getGUISheet() ){ + resources_->guiSystem->getGUISheet()->addChildWindow( rootWindow_ ); } } @@ -71,9 +71,9 @@ } void Console::stop( ){ - if ( devices_->guiSystem ){ - if ( devices_->guiSystem->getGUISheet() ){ - devices_->guiSystem->getGUISheet()->removeChildWindow( rootWindow_ ); + if ( resources_->guiSystem ){ + if ( resources_->guiSystem->getGUISheet() ){ + resources_->guiSystem->getGUISheet()->removeChildWindow( rootWindow_ ); } } InputManager::getSingleton().removeKeyListener( "ConsoleKeyListener" ); @@ -106,10 +106,10 @@ it = commands_.find( commandline[ 0 ] ); if ( it != commands_.end() ){ - (devices_->gameStateRoot->*it->second)( commandline ); + (resources_->gameStateRoot->*it->second)( commandline ); } else { MessageBodyChat chat( std::string( text.c_str() ) ); - devices_->network->send( chat ); + resources_->network->send( chat ); } editBox_->setText(""); } @@ -122,7 +122,7 @@ CEGUI::System::getSingleton().injectChar( e.text ); if ( e.key == OIS::KC_LCONTROL) { - devices_->setGlobalKeyModifier( KEY_LCONTROL ); + resources_->setGlobalKeyModifier( KEY_LCONTROL ); } return true; } @@ -130,7 +130,7 @@ bool Console::keyReleased( const OIS::KeyEvent & e ){ CEGUI::System::getSingleton().injectKeyUp( e.key ); if ( e.key == OIS::KC_LCONTROL) { - devices_->setGlobalKeyModifier( KEY_NONE ); + resources_->setGlobalKeyModifier( KEY_NONE ); } return true; } Modified: branches/ogsector/src/Console.h =================================================================== --- branches/ogsector/src/Console.h 2007-08-02 23:02:18 UTC (rev 651) +++ branches/ogsector/src/Console.h 2007-08-05 21:45:05 UTC (rev 652) @@ -68,7 +68,7 @@ CEGUI::Window * rootWindow_; - DeviceManager * devices_; + ResourceManager * resources_; CEGUI::Editbox * editBox_; CEGUI::Listbox * listBox_; Deleted: branches/ogsector/src/DeviceManager.cpp =================================================================== --- branches/ogsector/src/DeviceManager.cpp 2007-08-02 23:02:18 UTC (rev 651) +++ branches/ogsector/src/DeviceManager.cpp 2007-08-05 21:45:05 UTC (rev 652) @@ -1,135 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2007 by OpenGate development team * - * spo...@us... * - * * - * 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., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include "tinyxml/tinyxml.h" -#include "DeviceManager.h" -#include "LogManager.h" -#include <OgreArchiveManager.h> -#include <OgreFileSystem.h> - -namespace OpenGate{ - -template<> DeviceManager * Ogre::Singleton< DeviceManager >::ms_Singleton = 0; - -DeviceManager::DeviceManager( ) : modifier_( KEY_NONE ){ - log_ = LogManager::getSingletonPtr(); - - ogreRoot = NULL; - renderWindow = NULL; - inputManager = NULL; - guiRenderer = NULL; - guiSystem = NULL; - console = NULL; - network = NULL; - gameStateRoot = NULL; - avatar = NULL; - languageSuffix_ = "en"; - - mapping_ = true; -} - -DeviceManager::~DeviceManager( ) { -} - -std::string DeviceManager::factionName( int id ) { - if ( factionIDs_.count( id ) ){ - return factionIDs_[ id ]; - } - return "unknown"; -} - -void DeviceManager::loadGlobalIDs( const std::string & fileName ){ - -// Ogre::FileSystemArchive * pArch = new Ogre::FileSystemArchive( (*resourcePaths_.begin()), "FileSystem" ); -// Ogre::StringVectorPtr file = pArch->find( fileName, true, false); - -// std::string fileFullName( fileName ); -// if ( (*file).size() > 0 ){ -// fileFullName = (*resourcePaths_.begin() ) + "/" + (*file)[ 0 ] ; -// } - -// for ( unsigned int i = 0; i < (*file).size(); i ++ ){ -// log_->info( std::string( "Found ressource: " ) + (*resourcePaths_.begin() ) + "/" + (*file)[ i ] ); -// } -// delete pArch; - - TiXmlDocument doc( findFullFileName( fileName ) ); - bool loadOkay = doc.LoadFile(); - - if ( !loadOkay ) { - log_->fatal( std::string( "Failed to load id file: " + fileName ) ); - return; - } - - TiXmlHandle docHandle( &doc ); - TiXmlElement *pElem, *pElemId, *pElemName; - TiXmlHandle hRoot( 0 ); - - pElem = docHandle.FirstChildElement().Element(); - hRoot = TiXmlHandle( pElem ); - - if ( !pElem ) { - log_->fatal( fileName + " cannot read first node." ); - return; - } - - if ( strcmp( "container", pElem->Value() ) != 0 ) { - log_->fatal( fileName + " is no container description" ); - return; - } - - for ( pElem = hRoot.FirstChild( "faction" ).Element(); pElem != 0; pElem = pElem->NextSiblingElement("faction") ) { - pElemId = pElem->FirstChildElement( "faction_id" ); - pElemName = pElem->FirstChildElement( "name_en" ); - if ( pElemId && pElemName ) { - factionIDs_[ toInt( pElemId->FirstChild()->Value() ) ] = pElemName->FirstChild()->Value(); - } - } -} - -std::string DeviceManager::findFullFileName( const std::string & fileName ){ - - Ogre::FileSystemArchive pArch = Ogre::FileSystemArchive( (*resourcePaths_.begin()), "FileSystem" ); - Ogre::StringVectorPtr file = pArch.find( fileName, true, false); - - if ( (*file).size() > 0 ){ - return (*resourcePaths_.begin() ) + "/" + (*file)[ 0 ] ; - } - -// for ( unsigned int i = 0; i < (*file).size(); i ++ ){ -// log_->info( std::string( "Found ressource: " ) + (*resourcePaths_.begin() ) + "/" + (*file)[ i ] ); -// } - return "unknown"; -} - - -DeviceManager & DeviceManager::getSingleton( ){ - assert( ms_Singleton ); - return ( *ms_Singleton ); -} - -DeviceManager * DeviceManager::getSingletonPtr( ){ - if ( ms_Singleton == NULL ){ - std::cerr << "DeviceManager not initialized." << std::endl; - } - return ms_Singleton; -} - -} //namespace OpenGate Deleted: branches/ogsector/src/DeviceManager.h =================================================================== --- branches/ogsector/src/DeviceManager.h 2007-08-02 23:02:18 UTC (rev 651) +++ branches/ogsector/src/DeviceManager.h 2007-08-05 21:45:05 UTC (rev 652) @@ -1,125 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2007 by OpenGate development team * - * spo...@us... * - * * - * 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., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#ifndef _OPENGATE_DEVICEMANAGER__H -#define _OPENGATE_DEVICEMANAGER__H - -#include <OgreSingleton.h> - -namespace CEGUI { - class OgreCEGUIRenderer; - class System; -} - -namespace OpenGate{ - -enum EntityType{NONE,ENTITY,VESSEL,COMMODITY,POWERPLANT,ENGINE,RADAR,ECM,CAPACITOR,SHIELD,GUN,MISSILE,MODX}; -enum GunType{UNKNOWN,LASER,MININGLASER,BULLET}; - -/*! - * \brief This is a storage to handle current status of several things - * - * \todo Describe what it is used for, I don't really get it. - * The class holds all global information about games devices and ids - * \author Carsten <spo...@us...> - */ - -class NetworkClient; -class InputManager; -class LogManager; -class GameState; -class GameStateManager; -class Avatar; -class Console; - -enum GlobalKeyModifier{KEY_NONE, KEY_LCONTROL}; - -class DeviceManager : public Ogre::Singleton< DeviceManager > { -public: - DeviceManager( ); - - ~DeviceManager( ); - - /*! This method returns the single instance of the LogManager */ - static DeviceManager & getSingleton( void ); - - /*! This method return a pointer to the single instance of the LogManager */ - static DeviceManager * getSingletonPtr( void ); - - void setGlobalKeyModifier( GlobalKeyModifier modifier ){ modifier_ = modifier; } - GlobalKeyModifier globalKeyModifier( ) const { return modifier_; } - - std::string languageSuffix() const { return languageSuffix_; } - std::string className( int id ) const { return "unknown"; } - - void loadGlobalIDs( const std::string & fileName ); - - std::string factionName( int id ); - - std::string categoryName( EntityType rtti ) const { - switch( rtti ){ - case COMMODITY: return "Commodity"; - case POWERPLANT: return "Powerplant"; - case CAPACITOR: return "Capacitor"; - case ENGINE: return "Engine"; - case SHIELD: return "Shield"; - case RADAR: return "Radar"; - case ECM: return "ECM"; - case GUN: return "GUN"; - case MISSILE: return "MISSILE"; - case MODX: return "MODx"; - default: return "unknown"; - } - return "unknown"; - } - - Ogre::Root * ogreRoot; - Ogre::RenderWindow * renderWindow; - CEGUI::OgreCEGUIRenderer * guiRenderer; - CEGUI::System * guiSystem; - InputManager * inputManager; - NetworkClient * network; - Console * console; - GameStateManager * gameStateRoot; - Avatar * avatar; - - /*! Find file in resources and returns full name */ - std::string findFullFileName( const std::string & fileName ); - - std::set < std::string > & resourcePaths() { return resourcePaths_; } - - void setMappingCapability( bool mapping ) { mapping_ = mapping; } - bool mappingCapability() const { return mapping_; } - -protected: - LogManager * log_; - - GlobalKeyModifier modifier_; - std::string languageSuffix_; - - std::map< int, std::string > factionIDs_; - std::set < std::string > resourcePaths_; - - bool mapping_; -}; - -} //namespace OpenGate - -#endif // _OPENGATE_DEVICEMANAGER__H Modified: branches/ogsector/src/DockedState.cpp =================================================================== --- branches/ogsector/src/DockedState.cpp 2007-08-02 23:02:18 UTC (rev 651) +++ branches/ogsector/src/DockedState.cpp 2007-08-05 21:45:05 UTC (rev 652) @@ -39,17 +39,17 @@ } void DockedState::createContent(){ - sceneMgr_ = devices_->ogreRoot->createSceneManager( Ogre::ST_GENERIC, "DockedSceneManagerInstance" ); + sceneMgr_ = resources_->ogreRoot->createSceneManager( Ogre::ST_GENERIC, "DockedSceneManagerInstance" ); Ogre::Camera * camera = sceneMgr_->createCamera( "StationCamera" ); camera->setPosition( Ogre::Vector3( 0, 0, 10 ) ); camera->lookAt( Ogre::Vector3( 0, 0, 0 ) ); camera->setNearClipDistance( 1 ); -// Ogre::Viewport * vp = devices_->renderWindow->addViewport( sceneMgr_->getCamera( "StationCamera" ), 0, 0.0, 0.0, 1.0f, 1.0f ); +// Ogre::Viewport * vp = resources_->renderWindow->addViewport( sceneMgr_->getCamera( "StationCamera" ), 0, 0.0, 0.0, 1.0f, 1.0f ); // vp->setBackgroundColour( Ogre::ColourValue( 0, 0, 0) ); -// camera->setAspectRatio( (Ogre::Real)devices_->renderWindow->getViewport( 0 )->getActualWidth() / -// (Ogre::Real)devices_->renderWindow->getViewport( 0 )->getActualHeight() ); +// camera->setAspectRatio( (Ogre::Real)resources_->renderWindow->getViewport( 0 )->getActualWidth() / +// (Ogre::Real)resources_->renderWindow->getViewport( 0 )->getActualHeight() ); overlayRootWindow_ = CEGUI::WindowManager::getSingleton().loadWindowLayout((CEGUI::utf8*)"opengateDocked.layout"); @@ -88,24 +88,24 @@ sceneMgr_->destroyManualObject( "BackgroundObject" ); sceneMgr_->getRootSceneNode()->removeAndDestroyChild( "Background" ); CEGUI::WindowManager::getSingleton().destroyWindow( overlayRootWindow_ ); - devices_->ogreRoot->destroySceneManager( sceneMgr_ ); + resources_->ogreRoot->destroySceneManager( sceneMgr_ ); } void DockedState::enter( ) { launchUndockedState_ = false; log_->info("Entering dockstate"); - devices_->guiRenderer->setTargetSceneManager( sceneMgr_ ); - devices_->guiSystem->setGUISheet( overlayRootWindow_ ); + resources_->guiRenderer->setTargetSceneManager( sceneMgr_ ); + resources_->guiSystem->setGUISheet( overlayRootWindow_ ); overlayRootWindow_->show(); - devices_->console->start(); + resources_->console->start(); - devices_->inputManager->addKeyListener( this, "DockedStateKeyListener" ); - devices_->inputManager->addMouseListener( this, "DockedStateMouseListener" ); + resources_->inputManager->addKeyListener( this, "DockedStateKeyListener" ); + resources_->inputManager->addMouseListener( this, "DockedStateMouseListener" ); - devices_->guiSystem->setDefaultMouseCursor( (CEGUI::utf8*)"opengate", (CEGUI::utf8*)"MouseArrow" ); + resources_->guiSystem->setDefaultMouseCursor( (CEGUI::utf8*)"opengate", (CEGUI::utf8*)"MouseArrow" ); CEGUI::MouseCursor::getSingleton().setImage( (CEGUI::utf8*)"opengate", (CEGUI::utf8*)"MouseArrow" ); - Ogre::Viewport * vp = devices_->renderWindow->addViewport( sceneMgr_->getCamera( "StationCamera" ), 0, 0.0, 0.0, 1.0f, 1.0f ); + Ogre::Viewport * vp = resources_->renderWindow->addViewport( sceneMgr_->getCamera( "StationCamera" ), 0, 0.0, 0.0, 1.0f, 1.0f ); vp->setBackgroundColour( Ogre::ColourValue( 0, 0, 0) ); minimiseConsole( ); @@ -119,11 +119,11 @@ log_->info("Exiting dockstate"); overlayRootWindow_->hide(); - devices_->console->stop(); + resources_->console->stop(); - devices_->renderWindow->removeAllViewports(); - devices_->inputManager->removeKeyListener( "DockedStateKeyListener" ); - devices_->inputManager->removeMouseListener( "DockedStateMouseListener" ); + resources_->renderWindow->removeAllViewports(); + resources_->inputManager->removeKeyListener( "DockedStateKeyListener" ); + resources_->inputManager->removeMouseListener( "DockedStateMouseListener" ); } bool DockedState::frameStarted( const Ogre::FrameEvent & evt ){ @@ -199,15 +199,15 @@ CEGUI::PushButton::EventClicked, DockedState::handleMinimiseConsole ); wmgr.getWindow( (CEGUI::utf8*)"Docked/MainWindow/ConsoleBackground" )->subscribeEvent( - CEGUI::Window::EventSized, CEGUI::Event::Subscriber(&Console::handleResize, devices_->console ) ) ; + CEGUI::Window::EventSized, CEGUI::Event::Subscriber(&Console::handleResize, resources_->console ) ) ; } bool DockedState::handleLaunch( const CEGUI::EventArgs & e ){ - if ( !devices_->avatar->vessel()->powerPlant() ) { + if ( !resources_->avatar->vessel()->powerPlant() ) { log_->warn( "You have to equip a power plant first." ); return true; } - if ( !devices_->avatar->vessel()->engine() ) { + if ( !resources_->avatar->vessel()->engine() ) { log_->warn( "You have to equip an engine first." ); return true; } @@ -228,7 +228,7 @@ } bool DockedState::switchConfigDialog( ){ - devices_->gameStateRoot->switchConfigDialog( ); + resources_->gameStateRoot->switchConfigDialog( ); return true; } Modified: branches/ogsector/src/Entity.cpp =================================================================== --- branches/ogsector/src/Entity.cpp 2007-08-02 23:02:18 UTC (rev 651) +++ branches/ogsector/src/Entity.cpp 2007-08-05 21:45:05 UTC (rev 652) @@ -26,7 +26,7 @@ #include <CEGUIExceptions.h> #include <CEGUIBase.h> -#include "DeviceManager.h" +#include "ResourceManager.h" namespace OpenGate{ @@ -39,15 +39,31 @@ size_ = 1; rtti_ = ENTITY; factionID_ = 1; + baseSize_ = Ogre::Vector3::ZERO; + baseYaw_ = 0; + basePitch_ = 0; + baseRoll_ = 0; + imageInitialised_ = false; - setFactionName_( DeviceManager::getSingleton().factionName( factionID_ ) ); + setFactionName_( ResourceManager::getSingleton().factionName( factionID_ ) ); } void Entity::setFactionID( int id ){ factionID_ = id; - setFactionName_( DeviceManager::getSingleton().factionName( factionID_ ) ); + setFactionName_( ResourceManager::getSingleton().factionName( factionID_ ) ); } +void Entity::setBaseSize( float length, float width, float height ){ + baseSize_[ 0 ] = length; + baseSize_[ 1 ] = width; + baseSize_[ 2 ] = height; +} + + /*! If size is a scalar value, the length of the entity. */ +void Entity::setBaseSize( float size ){ baseSize_[ 2 ] = size; } + +Ogre::Vector3 Entity::baseSize( ) const { return baseSize_; } + void Entity::loadImages_( ) { imageInitialised_ = true; bool haveSmall = true; @@ -74,7 +90,7 @@ CEGUI::Texture * texture = NULL; try { - texture = dynamic_cast< CEGUI::OgreCEGUIRenderer * >( DeviceManager::getSingleton().guiRenderer )->createTexture( imageName, "General"); + texture = dynamic_cast< CEGUI::OgreCEGUIRenderer * >( ResourceManager::getSingleton().guiRenderer )->createTexture( imageName, "General"); } catch( CEGUI::Exception & e ){ if ( verbose ) LogManager::getSingleton().warn( e.getMessage().c_str() ); fail = true; Modified: branches/ogsector/src/Entity.h =================================================================== --- branches/ogsector/src/Entity.h 2007-08-02 23:02:18 UTC (rev 651) +++ branches/ogsector/src/Entity.h 2007-08-05 21:45:05 UTC (rev 652) @@ -21,13 +21,14 @@ #ifndef _OPENGATE_ENTITY_H #define _OPENGATE_ENTITY_H - #include <set> #include <string> #include "LogManager.h" -#include "DeviceManager.h" +#include "ResourceManager.h" +#include <OgreVector3.h> + namespace OpenGate{ class Commodity; @@ -65,6 +66,22 @@ inline void setID( int id ){ id_ = id; } inline int id( ) const { return id_; } + void setBaseSize( float length, float width, float height ); + + /*! If size is a scalar value, the length of the entity. */ + void setBaseSize( float size ); + + Ogre::Vector3 baseSize( ) const; + + inline void setBaseYaw( Ogre::Real baseYaw ){ baseYaw_ = baseYaw; } + inline Ogre::Real baseYaw( ) const { return baseYaw_; } + + inline void setBasePitch( Ogre::Real basePitch ){ basePitch_ = basePitch; } + inline Ogre::Real basePitch( ) const { return basePitch_; } + + inline void setBaseRoll( Ogre::Real baseRoll ){ baseRoll_ = baseRoll; } + inline Ogre::Real baseRoll( ) const { return baseRoll_; } + inline void setTechLevel( int level ){ techLevel_ = level; } inline int techLevel( ) const { return techLevel_; } @@ -104,6 +121,12 @@ std::string factionName_; int factionID_; + //** geometric parameters + Ogre::Vector3 baseSize_; + Ogre::Real baseYaw_; + Ogre::Real basePitch_; + Ogre::Real baseRoll_; + std::string imageFileName_; std::string ceguiSmallImageName_; std::string ceguiImageName_; @@ -149,12 +172,12 @@ inline void setEfficiency( double efficiency ) { efficiency_ = efficiency; } inline double efficiency( ) const { return efficiency_; } - inline void setPowerConsumption( Uint32 powerConsumption ) { + virtual void setPowerConsumption( Uint32 powerConsumption ) { powerConsumption_ = powerConsumption; //** if input power is < 1000, then input is scaled in kW if ( powerConsumption_ < 1e3 ) powerConsumption_ *= 1000; } - virtual inline Uint32 powerConsumption( ) { return powerConsumption_; } + virtual Uint32 powerConsumption( ) const { return powerConsumption_; } protected: Equipment() : Entity(), manufacturer_( "unkown" ) { @@ -223,7 +246,7 @@ } inline Uint32 maxThrust( ) { return maxThrust_; } - virtual Uint32 powerConsumption( ) const { return (Uint32)rint(( (float)maxThrust_ / efficiency_ )); } + virtual Uint32 powerConsumption( ) const { return (Uint32)rint( (float)maxThrust_ / efficiency_ ); } private: /*! Stores the maximum thrust of this engine */ Modified: branches/ogsector/src/EntityManager.cpp =================================================================== --- branches/ogsector/src/EntityManager.cpp 2007-08-02 23:02:18 UTC (rev 651) +++ branches/ogsector/src/EntityManager.cpp 2007-08-05 21:45:05 UTC (rev 652) @@ -19,7 +19,7 @@ ***************************************************************************/ #include "EntityManager.h" -#include "DeviceManager.h" +#include "ResourceManager.h" #include "tinyxml/tinyxml.h" #include <OgreArchive.h> #include <OgreArchiveManager.h> @@ -212,7 +212,7 @@ } //** Mandatory elements; - pElem = hRoot.ChildElement( "name_" + DeviceManager::getSingleton().languageSuffix(), 0 ).Element(); + pElem = hRoot.ChildElement( "name_" + ResourceManager::getSingleton().languageSuffix(), 0 ).Element(); if ( !pElem ){ //** fallback to english pElem = hRoot.ChildElement( "name_en", 0 ).Element(); } @@ -246,7 +246,7 @@ //** Generic elements pElem = hRoot.ChildElement( "class_id", 0 ).Element(); - if ( pElem ) entity->setClassName( DeviceManager::getSingleton().className( toInt( pElem->FirstChild()->Value() ) ) ); + if ( pElem ) entity->setClassName( ResourceManager::getSingleton().className( toInt( pElem->FirstChild()->Value() ) ) ); pElem = hRoot.ChildElement( "techlevel", 0 ).Element(); if ( pElem ) entity->setTechLevel( toInt( pElem->FirstChild()->Value() ) ); @@ -271,7 +271,7 @@ pElem = hRoot.ChildElement( "power_input", 0 ).Element(); if ( pElem ) powerConsumption = toInt( pElem->FirstChild()->Value() ); - pElem = hRoot.ChildElement( "description_" + DeviceManager::getSingleton().languageSuffix(), 0 ).Element(); + pElem = hRoot.ChildElement( "description_" + ResourceManager::getSingleton().languageSuffix(), 0 ).Element(); if ( !pElem ){ //** fallback to english pElem = hRoot.ChildElement( "description_en", 0 ).Element(); } @@ -465,7 +465,7 @@ return NULL; } - pElem = hRoot.ChildElement( "name_" + DeviceManager::getSingleton().languageSuffix(), 0 ).Element(); + pElem = hRoot.ChildElement( "name_" + ResourceManager::getSingleton().languageSuffix(), 0 ).Element(); if ( !pElem ){ //** Fallback to english pElem = hRoot.ChildElement( "name_en", 0 ).Element(); @@ -492,7 +492,7 @@ //** Generic data pElem = hRoot.ChildElement( "class_id", 0 ).Element(); - if ( pElem ) entity->setClassName( DeviceManager::getSingleton().className( toInt( pElem->FirstChild()->Value() ) ) ); + if ( pElem ) entity->setClassName( ResourceManager::getSingleton().className( toInt( pElem->FirstChild()->Value() ) ) ); pElem = hRoot.ChildElement( "techlevel", 0 ).Element(); if ( pElem ) entity->setTechLevel( toInt( pElem->FirstChild()->Value() ) ); @@ -507,7 +507,7 @@ if ( pElem ) entity->setFactionID( toInt( pElem->FirstChild()->Value() ) ); //** Additional Data - pElem = hRoot.ChildElement( "description_" + DeviceManager::getSingleton().languageSuffix(), 0 ).Element(); + pElem = hRoot.ChildElement( "description_" + ResourceManager::getSingleton().languageSuffix(), 0 ).Element(); if ( pElem ) entity->setDescription( pElem->FirstChild()->Value() ); //** Specific Data Modified: branches/ogsector/src/GameState.h =================================================================== --- branches/ogsector/src/GameState.h 2007-08-02 23:02:18 UTC (rev 651) +++ branches/ogsector/src/GameState.h 2007-08-05 21:45:05 UTC (rev 652) @@ -37,7 +37,7 @@ #include <OgreFrameListener.h> #include <string> -#include "DeviceManager.h" +#include "ResourceManager.h" #include "InputManager.h" namespace OpenGate{ @@ -99,7 +99,7 @@ void destroy( void ){ destroyContent(); delete this; } /*! Initialize the game state with device information. */ - void init( ) { devices_ = DeviceManager::getSingletonPtr(); createContent(); } + void init( ) { resources_ = ResourceManager::getSingletonPtr(); createContent(); } /*! Returns the gamestate name */ std::string name() const { return name_; } @@ -180,13 +180,12 @@ /*! Stores the GameStateManager which is managing this state. */ GameStateListener * parent_; - std::string name_; + ResourceManager * resources_; - /** Keeps a method of device interaction. */ - DeviceManager * devices_; - LogManager * log_; + std::string name_; + CEGUI::Window * overlayRootWindow_; }; Modified: branches/ogsector/src/GameStateManager.cpp =================================================================== --- branches/ogsector/src/GameStateManager.cpp 2007-08-02 23:02:18 UTC (rev 651) +++ branches/ogsector/src/GameStateManager.cpp 2007-08-05 21:45:05 UTC (rev 652) @@ -45,7 +45,7 @@ class NetworkClient; GameStateManager::GameStateManager( NetworkClient & nw, bool dialog ) { - devices_.network = & nw; + resources_.network = & nw; log_ = NULL; vesselManager_ = NULL; configDialog_ = NULL; @@ -53,7 +53,7 @@ //** without any gamestate, shutdown immediately; shutdownRequest_ = true; - initialiseDevices_( dialog ); + initialiseResources( dialog ); shutdownRequest_ = false; //** start for test purposes; @@ -69,9 +69,7 @@ // Ogre::SceneManager* sceneMgr = devices_.ogreRoot->createSceneManager(Ogre::ST_GENERIC); // Ogre::Camera* camera = sceneMgr->createCamera("SimpleCamera"); -// Ogre::Viewport* viewPort = devices_.renderWindow->addViewport(camera); -// Ogre::FrameListener frameListener; -// devices_.ogreRoot->addFrameListener(&frameListener); +// resources_.ogreRoot->addFrameListener(&frameListener); // camera->setPosition( Ogre::Vector3( 0, 0, 200 ) ); // camera->lookAt( Ogre::Vector3( 0, 0, -300 ) ); // camera->setNearClipDistance( 1 ); @@ -102,7 +100,7 @@ // mainNode->attachObject( shape ); // devices_.ogreRoot->startRendering(); // while( 1 ){ -// devices_.ogreRoot->renderOneFrame( ); +// resources_.ogreRoot->renderOneFrame( ); // } //** end just for test purposes @@ -110,8 +108,8 @@ } GameStateManager::~GameStateManager( ){ -// delete devices_->guiSystem; -// delete devices_->guiRenderer; +// delete resources_->guiSystem; +// delete resources_->guiRenderer; while ( !stateStack_.empty() ){ cleanup_( stateStack_.back() ); @@ -123,10 +121,10 @@ states_.pop_back(); } - if ( devices_.console ){ + if ( resources_.console ){ log_->info( "Shutdown console." ); - delete devices_.console; - devices_.console = NULL; + delete resources_.console; + resources_.console = NULL; } if ( commodityManager_ ){ log_->info( "Shutdown commoditymanager." ); @@ -143,17 +141,17 @@ delete vesselManager_; vesselManager_ = NULL; } - if ( devices_.inputManager ) { + if ( resources_.inputManager ) { log_->info( "Shutdown inputmanager." ); - delete devices_.inputManager; - devices_.inputManager = NULL; + delete resources_.inputManager; + resources_.inputManager = NULL; } log_->info( "Shutdown renderWindow." ); - if ( devices_.renderWindow ) delete devices_.renderWindow; + if ( resources_.renderWindow ) delete resources_.renderWindow; log_->info( "Shutdown ogreRoot." ); //** segfault caused by destroying ShipConfigDialog::ceguiTex_ - // if ( devices_.ogreRoot ) delete devices_.ogreRoot; + // if ( resources_.ogreRoot ) delete resources_.ogreRoot; } void GameStateManager::switchConfigDialog( ){ @@ -182,7 +180,7 @@ } while ( !shutdownRequest_ ){ - devices_.inputManager->capture(); + resources_.inputManager->capture(); if ( enterDockedStateHack_ ) start( findByName( "DockedState" ) ); @@ -203,7 +201,7 @@ } } #endif - devices_.ogreRoot->renderOneFrame( ); + resources_.ogreRoot->renderOneFrame( ); } } @@ -211,7 +209,7 @@ //** start capture network; std::vector < std::vector < char > > msgs; std::vector < MessageBodyShipMovement * > movements; - devices_.network->pull( msgs ); + resources_.network->pull( msgs ); Sector * sector = NULL; if ( stateStack_.back()->name() == "UnDockedState" ){ @@ -230,9 +228,9 @@ switch ( msgs[ i ][ 0 ] ){ case PROTO_CHAT:{ - devices_.network->ping(); + resources_.network->ping(); MessageBodyChat msg( &msgs[ i ][ 0 ] ); - log_->chat( devices_.network->userName( msg.senderID() ), msg.message() ); + log_->chat( resources_.network->userName( msg.senderID() ), msg.message() ); } break; case PROTO_SHIP_REGISTER: if ( sector ) sector->receiveVesselRegister( &msgs[ i ][ 0 ] ); break; @@ -329,71 +327,73 @@ } void GameStateManager::init_( GameState * state ) { - devices_.ogreRoot->addFrameListener( state ); + resources_.ogreRoot->addFrameListener( state ); } void GameStateManager::cleanup_( GameState * state ){ - devices_.ogreRoot->removeFrameListener( state ); + resources_.ogreRoot->removeFrameListener( state ); } -bool GameStateManager::initialiseDevices_( bool dialog ){ +bool GameStateManager::initialiseResources( bool dialog ){ log_ = LogManager::getSingletonPtr(); - devices_.ogreRoot = new Ogre::Root; + resources_.ogreRoot = new Ogre::Root; if ( !initialiseOgreEngine_( dialog ) ) return false; if ( !initialiseOgreResources_() ) return false; - const Ogre::RenderSystemCapabilities * caps = DeviceManager::getSingleton().ogreRoot->getRenderSystem()->getCapabilities(); + const Ogre::RenderSystemCapabilities * caps = ResourceManager::getSingleton().ogreRoot->getRenderSystem()->getCapabilities(); if ( !caps->hasCapability( Ogre::RSC_VERTEX_PROGRAM ) ) { log_->warn("Your card does not support vertex programs."); - DeviceManager::getSingleton().setMappingCapability( false ); + ResourceManager::getSingleton().setMappingCapability( false ); } if ( !( caps->hasCapability( Ogre::RSC_FRAGMENT_PROGRAM ) || caps->hasCapability( Ogre::RSC_DOT3 ) ) ) { log_->warn("Your card does not support dot3 blending or fragment programs." ); - DeviceManager::getSingleton().setMappingCapability( false ); + ResourceManager::getSingleton().setMappingCapability( false ); } if ( !initialiseCEGUIEngine_( ) ) return false; if ( !initialiseInputManager_() ) return false; - devices_.console = new Console( ); - devices_.ogreRoot->addFrameListener( devices_.console ); - LogManager::getSingleton().setConsole( devices_.console ); + resources_.console = new Console( ); + resources_.ogreRoot->addFrameListener( resources_.console ); + LogManager::getSingleton().setConsole( resources_.console ); - devices_.console->addCommand( "/q", &GameStateManager::CMD_shutdown, "Shutting down the client. Shortcut for /quit" ); - devices_.console->addCommand( "/quit", &GameStateManager::CMD_shutdown, "Shutting down the client" ); - devices_.console->addCommand( "/help", &GameStateManager::CMD_printHelp, "Show this help" ); - devices_.console->addCommand( "/time", &GameStateManager::CMD_printTime, "Show current system time" ); - devices_.console->addCommand( "/ai", &GameStateManager::CMD_spawnAi, "[name] Spawn ai subject. /ai help show all available ships." ); + resources_.console->addCommand( "/q", &GameStateManager::CMD_shutdown, "Shutting down the client. Shortcut for /quit" ); + resources_.console->addCommand( "/quit", &GameStateManager::CMD_shutdown, "Shutting down the client" ); + resources_.console->addCommand( "/help", &GameStateManager::CMD_printHelp, "Show this help" ); + resources_.c... [truncated message content] |