[FIX] fixed the loading scene, everything runs correctly now
This commit is contained in:
@@ -113,7 +113,8 @@ namespace scene
|
||||
}
|
||||
int z_offset = model_pos * (house_generator->GetHouseDepth()); // how much "in the distance" we should load the model
|
||||
|
||||
std::deque<std::shared_ptr<entities::Entity>> furniture = house_generator->GenerateHouse(glm::vec3(0, -75, -50 - z_offset), 90);
|
||||
std::deque<std::shared_ptr<entities::Entity>> furniture;
|
||||
house_generator->GenerateHouse(&furniture, glm::vec3(0, -75, -50 - z_offset), 90);
|
||||
furniture_count = furniture.size();
|
||||
|
||||
house_models.insert(house_models.end(), furniture.begin(), furniture.end());
|
||||
@@ -212,7 +213,7 @@ namespace scene
|
||||
}
|
||||
shader->CleanUp();
|
||||
gui_shader->CleanUp();
|
||||
render_engine::loader::CleanUp();
|
||||
//render_engine::loader::CleanUp();
|
||||
return return_value;
|
||||
}
|
||||
|
||||
|
||||
@@ -90,45 +90,54 @@ namespace scene
|
||||
singleton::Model_Storage::get_instance()->add_couch({ render_engine::LoadObjModel("res/couchThree.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_couch({ render_engine::LoadObjModel("res/Coach.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_couch({ render_engine::LoadObjModel("res/lawnBenchOne.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
|
||||
singleton::Model_Storage::get_instance()->add_furniture_model({ {singleton::FurnitureType::COUCH, 2}, singleton::Model_Storage::get_instance()->get_all_couches() });
|
||||
|
||||
// Tables
|
||||
singleton::Model_Storage::get_instance()->add_couch({ render_engine::LoadObjModel("res/tableOne.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_couch({ render_engine::LoadObjModel("res/tableTwo.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_couch({ render_engine::LoadObjModel("res/bureauOne.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_table({ render_engine::LoadObjModel("res/tableOne.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_table({ render_engine::LoadObjModel("res/tableTwo.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_table({ render_engine::LoadObjModel("res/bureauOne.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_furniture_model({ {singleton::FurnitureType::TABLE, 2}, singleton::Model_Storage::get_instance()->get_all_tables() });
|
||||
|
||||
// Chairs
|
||||
singleton::Model_Storage::get_instance()->add_couch({ render_engine::LoadObjModel("res/launchchair.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_couch({ render_engine::LoadObjModel("res/lawnChairOne.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_couch({ render_engine::LoadObjModel("res/ugly_chair.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_chair({ render_engine::LoadObjModel("res/launchchair.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_chair({ render_engine::LoadObjModel("res/lawnChairOne.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_chair({ render_engine::LoadObjModel("res/ugly_chair.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_furniture_model({ {singleton::FurnitureType::CHAIR, 1}, singleton::Model_Storage::get_instance()->get_all_chairs() });
|
||||
|
||||
// Plants
|
||||
singleton::Model_Storage::get_instance()->add_couch({ render_engine::LoadObjModel("res/plantOne.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_couch({ render_engine::LoadObjModel("res/plantTwo.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_couch({ render_engine::LoadObjModel("res/plantThree.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_plant({ render_engine::LoadObjModel("res/plantOne.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_plant({ render_engine::LoadObjModel("res/plantTwo.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_plant({ render_engine::LoadObjModel("res/plantThree.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_furniture_model({ {singleton::FurnitureType::PLANT, 1}, singleton::Model_Storage::get_instance()->get_all_plants() });
|
||||
|
||||
// Guitars
|
||||
singleton::Model_Storage::get_instance()->add_couch({ render_engine::LoadObjModel("res/guitarOne.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_couch({ render_engine::LoadObjModel("res/guitarTwo.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
|
||||
singleton::Model_Storage::get_instance()->add_guitar({ render_engine::LoadObjModel("res/guitarOne.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_guitar({ render_engine::LoadObjModel("res/guitarTwo.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_furniture_model({ {singleton::FurnitureType::GUITAR, 1}, singleton::Model_Storage::get_instance()->get_all_guitars() });
|
||||
|
||||
// Bookshelves
|
||||
singleton::Model_Storage::get_instance()->add_couch({ render_engine::LoadObjModel("res/bookShelfOne.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_couch({ render_engine::LoadObjModel("res/bookShelfTwo.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_couch({ render_engine::LoadObjModel("res/bookShelfThree.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_bookshelf({ render_engine::LoadObjModel("res/bookShelfOne.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_bookshelf({ render_engine::LoadObjModel("res/bookShelfTwo.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_bookshelf({ render_engine::LoadObjModel("res/bookShelfThree.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_furniture_model({ {singleton::FurnitureType::BOOKSHELF, 1}, singleton::Model_Storage::get_instance()->get_all_bookshelves() });
|
||||
|
||||
// Lamps
|
||||
singleton::Model_Storage::get_instance()->add_couch({ render_engine::LoadObjModel("res/lampOne.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_couch({ render_engine::LoadObjModel("res/lampTwo.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_lamp({ render_engine::LoadObjModel("res/lampOne.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_lamp({ render_engine::LoadObjModel("res/lampTwo.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_furniture_model({ {singleton::FurnitureType::LAMP, 1}, singleton::Model_Storage::get_instance()->get_all_lamps() });
|
||||
|
||||
// Ceiling objects
|
||||
singleton::Model_Storage::get_instance()->add_couch({ render_engine::LoadObjModel("res/ceilingFan.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_couch({ render_engine::LoadObjModel("res/ceilingFanTwo.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_couch({ render_engine::LoadObjModel("res/ceilingLampOne.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_couch({ render_engine::LoadObjModel("res/ceilingLampTwo.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_ceiling_object({ render_engine::LoadObjModel("res/ceilingFan.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_ceiling_object({ render_engine::LoadObjModel("res/ceilingFanTwo.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_ceiling_object({ render_engine::LoadObjModel("res/ceilingLampOne.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_ceiling_object({ render_engine::LoadObjModel("res/ceilingLampTwo.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_furniture_model({ {singleton::FurnitureType::CEILING_OBJECTS, 1}, singleton::Model_Storage::get_instance()->get_all_ceiling_objects() });
|
||||
|
||||
// Miscs
|
||||
singleton::Model_Storage::get_instance()->add_couch({ render_engine::LoadObjModel("res/tv.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_couch({ render_engine::LoadObjModel("res/radio.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_couch({ render_engine::LoadObjModel("res/Flowerpot.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_misc({ render_engine::LoadObjModel("res/tv.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_misc({ render_engine::LoadObjModel("res/radio.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_misc({ render_engine::LoadObjModel("res/Flowerpot.obj"), singleton::Model_Storage::get_instance()->get_default_texture() });
|
||||
singleton::Model_Storage::get_instance()->add_furniture_model({ {singleton::FurnitureType::MISC, 1}, singleton::Model_Storage::get_instance()->get_all_miscs() });
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ namespace scene
|
||||
glfwPollEvents();
|
||||
}
|
||||
gui_shader1->CleanUp();
|
||||
render_engine::loader::CleanUp();
|
||||
//render_engine::loader::CleanUp();
|
||||
return return_value;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user