Changeset 3237
- Timestamp:
- 01/01/09 23:49:53 (16 years ago)
- Location:
- GTP/trunk/App/Demos/Vis/FriendlyCulling
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/FriendlyCulling/FriendlyCulling.sln
r3235 r3237 12 12 EndProject 13 13 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VboFormatConverter", "VboFormatConverter.vcproj", "{93A522E1-76F0-4D46-9C97-30DC2DDB531B}" 14 EndProject15 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IrradianceMapping", "IrradianceMapping.vcproj", "{91680C49-A358-48AE-A02C-66CB884B7D7F}"16 ProjectSection(ProjectDependencies) = postProject17 {03661866-4093-4B02-B26A-028EA91AF023} = {03661866-4093-4B02-B26A-028EA91AF023}18 EndProjectSection19 14 EndProject 20 15 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VisibilitySolutionConverter", "VisibilitySolutionConverter.vcproj", "{A07AEF7C-5A28-4881-AE56-F9C5FFA3FEC4}" … … 42 37 {93A522E1-76F0-4D46-9C97-30DC2DDB531B}.Release|Win32.ActiveCfg = Release|Win32 43 38 {93A522E1-76F0-4D46-9C97-30DC2DDB531B}.Release|Win32.Build.0 = Release|Win32 44 {91680C49-A358-48AE-A02C-66CB884B7D7F}.Debug|Win32.ActiveCfg = Debug|Win3245 {91680C49-A358-48AE-A02C-66CB884B7D7F}.Debug|Win32.Build.0 = Debug|Win3246 {91680C49-A358-48AE-A02C-66CB884B7D7F}.Release|Win32.ActiveCfg = Release|Win3247 {91680C49-A358-48AE-A02C-66CB884B7D7F}.Release|Win32.Build.0 = Release|Win3248 39 {A07AEF7C-5A28-4881-AE56-F9C5FFA3FEC4}.Debug|Win32.ActiveCfg = Debug|Win32 49 40 {A07AEF7C-5A28-4881-AE56-F9C5FFA3FEC4}.Debug|Win32.Build.0 = Debug|Win32 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ResourceManager.cpp
r3236 r3237 196 196 197 197 198 voidResourceManager::LoadTextures(igzstream &str)198 int ResourceManager::LoadTextures(igzstream &str) 199 199 { 200 200 int numTextures; … … 228 228 } 229 229 230 cout << "loaded " << (int)mTextureTable.size() << " textures" << endl;231 } 232 233 // mtt todo_ split that up234 voidResourceManager::LoadShapes(igzstream &str)230 return numTextures; 231 } 232 233 // todo: split up geometry and materials!! 234 int ResourceManager::LoadShapes(igzstream &str) 235 235 { 236 236 int numShapes; … … 249 249 } 250 250 251 cout << "loaded " << (int)mGeometryTable.size() << " shapes" << endl;251 return numShapes; 252 252 } 253 253 … … 393 393 394 394 395 voidResourceManager::LoadSceneEntities(igzstream &str,396 395 int ResourceManager::LoadSceneEntities(igzstream &str, 396 SceneEntityContainer &entities) 397 397 { 398 398 int entityCount; … … 411 411 } 412 412 413 cout << "loaded " << entityCount << " scene entities" << endl;414 } 415 416 417 boolResourceManager::Load(const std::string &filename,418 413 return entityCount; 414 } 415 416 417 int ResourceManager::Load(const std::string &filename, 418 SceneEntityContainer &entities) 419 419 { 420 420 igzstream istr(filename.c_str()); 421 421 422 422 if (!istr.is_open()) 423 return false;423 return 0; 424 424 425 425 cout << "loading textures" << endl; 426 426 427 427 // load the texture table 428 LoadTextures(istr); 428 int numTextures = LoadTextures(istr); 429 430 cout << "loaded " << numTextures << " textures" << endl; 429 431 430 432 cout << "loading shapes (geometry + materials)" << endl; 431 433 432 434 // load the shapees 433 LoadShapes(istr); 435 int numShapes = LoadShapes(istr); 436 437 cout << "loaded " << (int)mGeometryTable.size() << " shapes" << endl; 434 438 435 439 cout << "loading scene entites" << endl; 436 LoadSceneEntities(istr, entities); 437 440 441 int numEntities = LoadSceneEntities(istr, entities); 442 443 cout << "loaded " << numEntities << " scene entities" << endl; 444 438 445 cout << "bin loading finished" << endl; 439 446 440 // clean up 447 // clean up temporary tables 441 448 mTextureTable.clear(); 442 449 mGeometryTable.clear(); 443 450 mMaterialTable.clear(); 444 451 445 return true;452 return numEntities; 446 453 } 447 454 -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/ResourceManager.h
r3226 r3237 32 32 public: 33 33 34 /** Loads a model 34 /** Loads a scene containing of several scene entities. the entities are added to 35 the previously loaded entities. Returns the number of entities in the 36 scene. 35 37 */ 36 boolLoad(const std::string &filename, SceneEntityContainer &geometry);38 int Load(const std::string &filename, SceneEntityContainer &geometry); 37 39 /** Returns number of scene entities loaded with this manager. 38 40 */ … … 60 62 Material *CreateMaterial(); 61 63 64 ///////////////// 65 62 66 /// giant hack: set this to true if the geometry to load has tangent data for normal mapping 63 67 bool mUseNormalMapping; … … 75 79 ~ResourceManager(); 76 80 77 voidLoadTextures(igzstream &str);78 voidLoadShapes(igzstream &str);79 voidLoadSceneEntities(igzstream &str, SceneEntityContainer &entities);81 int LoadTextures(igzstream &str); 82 int LoadShapes(igzstream &str); 83 int LoadSceneEntities(igzstream &str, SceneEntityContainer &entities); 80 84 81 85 SceneEntity *LoadSceneEntity(igzstream &str); -
GTP/trunk/App/Demos/Vis/FriendlyCulling/src/chcdemo.cpp
r3236 r3237 335 335 void PrepareRenderQueue(); 336 336 /// loads the specified model 337 voidLoadModel(const string &model, SceneEntityContainer &entities);337 int LoadModel(const string &model, SceneEntityContainer &entities); 338 338 339 339 inline float KeyRotationAngle() { return keyRotation * elapsedTime * 1e-3f; } … … 578 578 579 579 580 LoadModel("vienna_full_hp.dem", dynamicObjects); 581 dynamicObjects.back()->GetTransform()->SetMatrix(transl); 580 int cityEntities = LoadModel("vienna_full_hp.dem", dynamicObjects); 581 582 for (int i = (int)dynamicObjects.size() - cityEntities; i < (int)dynamicObjects.size(); ++ i) 583 dynamicObjects[i]->GetTransform()->SetMatrix(transl); 582 584 583 585 … … 2408 2410 2409 2411 2410 voidLoadModel(const string &model, SceneEntityContainer &entities)2412 int LoadModel(const string &model, SceneEntityContainer &entities) 2411 2413 { 2412 2414 const string filename = string(model_path + model); 2413 2415 2416 int numEntities = 0; 2417 2414 2418 cout << "\nloading model " << filename << endl; 2415 if (resourceManager->Load(filename, entities)) 2419 2420 if (numEntities = resourceManager->Load(filename, entities)) 2416 2421 { 2417 2422 cout << "model " << filename << " successfully loaded" << endl; … … 2424 2429 exit(0); 2425 2430 } 2431 2432 return numEntities; 2426 2433 } 2427 2434
Note: See TracChangeset
for help on using the changeset viewer.