[FIX] fixed the loading scene, everything runs correctly now
This commit is contained in:
@@ -5,50 +5,14 @@
|
||||
#include <map>
|
||||
#include "../models/Model.h"
|
||||
#include "../collision/collision.h"
|
||||
#include "../model_Storage.h"
|
||||
|
||||
namespace entities
|
||||
{
|
||||
enum class FurnitureType
|
||||
{
|
||||
COUCH,
|
||||
TABLE,
|
||||
CHAIR,
|
||||
PLANT,
|
||||
GUITAR,
|
||||
BOOKSHELF,
|
||||
LAMP,
|
||||
CEILING_OBJECTS,
|
||||
MISC
|
||||
};
|
||||
struct FurniturePiece
|
||||
{
|
||||
FurnitureType type;
|
||||
int size;
|
||||
};
|
||||
|
||||
struct FurnitureModel
|
||||
{
|
||||
FurniturePiece furniture;
|
||||
std::deque<models::TexturedModel> texture;
|
||||
|
||||
bool operator<(FurnitureModel a)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
class HouseGenerator
|
||||
{
|
||||
private:
|
||||
const float HOUSE_SIZE = 30;
|
||||
|
||||
models::TexturedModel house_model;
|
||||
models::ModelTexture default_texture;
|
||||
|
||||
//std::map<FurniturePiece, std::deque<models::TexturedModel>> furniture_models;
|
||||
std::deque<FurnitureModel> furniture_models;
|
||||
public:
|
||||
HouseGenerator();
|
||||
|
||||
@@ -60,21 +24,16 @@ namespace entities
|
||||
*
|
||||
* @return: A list with all the entities of the generated house (the furniture)
|
||||
*/
|
||||
std::deque<std::shared_ptr<Entity>> GenerateHouse(const glm::vec3& position, float y_rotation);
|
||||
void GenerateHouse(std::deque<std::shared_ptr<Entity>>* furniture_list, const glm::vec3& position, float y_rotation);
|
||||
|
||||
/*
|
||||
* @brief: Returns the depth of the house (chunk)
|
||||
*/
|
||||
float GetHouseDepth() const { return house_model.raw_model.model_size.x * HOUSE_SIZE; }
|
||||
float GetHouseDepth() const { return singleton::Model_Storage::get_instance()->get_house_model().raw_model.model_size.x * HOUSE_SIZE; }
|
||||
|
||||
private:
|
||||
const FurniturePiece* GetRandomFurniturePiece();
|
||||
const FurniturePiece* GetFurniturePiece(FurnitureType type);
|
||||
|
||||
/*
|
||||
* @brief: This function loads all the 3D furniture models
|
||||
*/
|
||||
void GenerateFurnitureModels();
|
||||
void GetRandomFurniturePiece(singleton::FurniturePiece* furniture_piece);
|
||||
void GetFurniturePiece(singleton::FurnitureType type, singleton::FurniturePiece* furniture_piece);
|
||||
|
||||
/*
|
||||
* @brief: This funtion chooses and returns a random furniture of the given furniture type
|
||||
@@ -83,6 +42,6 @@ namespace entities
|
||||
*
|
||||
* @return: The model of the random furniture of the chosen furniture type
|
||||
*/
|
||||
models::TexturedModel GetFurnitureModel(const FurniturePiece* furniture);
|
||||
models::TexturedModel GetFurnitureModel(const singleton::FurniturePiece* furniture);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user