refactor #1
This commit is contained in:
@@ -20,8 +20,9 @@
|
||||
/** Calculate square spiral offsets and initialize floors
|
||||
* @param floorAmount must be a number from square root table
|
||||
*/
|
||||
FloorManager::FloorManager(int t_floorAmount)
|
||||
FloorManager::FloorManager(int t_floorAmount, TextureRepository *t_texRepo)
|
||||
{
|
||||
texRepo = t_texRepo;
|
||||
floorAmount = t_floorAmount;
|
||||
spirals = new Point[t_floorAmount];
|
||||
int floorSpiralMaxOffset = (int)Math::sqrt(t_floorAmount);
|
||||
@@ -84,8 +85,13 @@ void FloorManager::initFloors()
|
||||
floors[0].mesh.loadObj("meshes/floor/", "floor", 3.0F, false);
|
||||
floors[0].mesh.shouldBeFrustumCulled = true;
|
||||
floors[0].mesh.shouldBeLighted = true;
|
||||
texRepo->addByMesh("meshes/floor/", floors[0].mesh, BMP);
|
||||
for (u16 i = 1; i < floorAmount; i++)
|
||||
{
|
||||
floors[i].init(floors[0].mesh, spirals[i], i);
|
||||
texRepo->getByMesh(floors[0].mesh.getId(), floors[0].mesh.getMaterial(0).getId())
|
||||
->addLink(floors[i].mesh.getId(), floors[i].mesh.getMaterial(0).getId());
|
||||
}
|
||||
PRINT_LOG("Floors initialized!");
|
||||
}
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
class Player; // Forward definition
|
||||
|
||||
#include <models/math/point.hpp>
|
||||
#include <modules/texture_repository.hpp>
|
||||
#include <modules/camera_base.hpp>
|
||||
#include <models/audio_listener.hpp>
|
||||
|
||||
@@ -24,7 +25,7 @@ class FloorManager
|
||||
{
|
||||
|
||||
public:
|
||||
FloorManager(int t_floorAmount);
|
||||
FloorManager(int t_floorAmount, TextureRepository *t_texRepo);
|
||||
~FloorManager();
|
||||
Floor floors[144]; // Temp change it also in floors.cpp
|
||||
u16 floorAmount;
|
||||
@@ -32,6 +33,7 @@ public:
|
||||
void onAudioTick();
|
||||
|
||||
private:
|
||||
TextureRepository *texRepo;
|
||||
u8 audioOffset, audioMode;
|
||||
u32 audioTick;
|
||||
float trick;
|
||||
|
||||
Reference in New Issue
Block a user