demo fixes
This commit is contained in:
@@ -28,12 +28,10 @@ EnemyManager::EnemyManager(Engine* engine, const Heightmap& heightmap) {
|
|||||||
objOptions.flipUVs = true;
|
objOptions.flipUVs = true;
|
||||||
objOptions.scale = 250.0F;
|
objOptions.scale = 250.0F;
|
||||||
|
|
||||||
auto* data = loader.load(FileUtils::fromCwd("game/models/zombie/zombie.obj"),
|
auto data = loader.load(FileUtils::fromCwd("game/models/zombie/zombie.obj"),
|
||||||
objOptions);
|
objOptions);
|
||||||
data->normalsEnabled = false;
|
data->normalsEnabled = false;
|
||||||
motherMesh = new DynamicMesh(*data);
|
motherMesh = new DynamicMesh(data.get());
|
||||||
|
|
||||||
delete data;
|
|
||||||
|
|
||||||
bodyTexture = textureRepo->add(
|
bodyTexture = textureRepo->add(
|
||||||
FileUtils::fromCwd("game/models/zombie/BodyMaterial.png"));
|
FileUtils::fromCwd("game/models/zombie/BodyMaterial.png"));
|
||||||
|
|||||||
@@ -26,11 +26,10 @@ Weapon::Weapon(Engine* engine) {
|
|||||||
pad = &engine->pad;
|
pad = &engine->pad;
|
||||||
audio = &engine->audio;
|
audio = &engine->audio;
|
||||||
auto* repo = &engine->renderer.core.texture.repository;
|
auto* repo = &engine->renderer.core.texture.repository;
|
||||||
auto* data =
|
auto data =
|
||||||
loader.load(FileUtils::fromCwd("game/models/ak47/ak47.obj"), objOptions);
|
loader.load(FileUtils::fromCwd("game/models/ak47/ak47.obj"), objOptions);
|
||||||
data->normalsEnabled = false;
|
data->normalsEnabled = false;
|
||||||
mesh = new StaticMesh(*data);
|
mesh = new StaticMesh(data.get());
|
||||||
delete data;
|
|
||||||
|
|
||||||
mesh->translation.translateX(2.85F);
|
mesh->translation.translateX(2.85F);
|
||||||
mesh->translation.translateY(-3.40F);
|
mesh->translation.translateY(-3.40F);
|
||||||
|
|||||||
@@ -23,10 +23,9 @@ Ship::Ship(TextureRepository* repo) {
|
|||||||
objOptions.flipUVs = true;
|
objOptions.flipUVs = true;
|
||||||
objOptions.scale = 200.0F;
|
objOptions.scale = 200.0F;
|
||||||
|
|
||||||
auto* data =
|
auto data =
|
||||||
loader.load(FileUtils::fromCwd("game/models/ship/ship.obj"), objOptions);
|
loader.load(FileUtils::fromCwd("game/models/ship/ship.obj"), objOptions);
|
||||||
mesh = new StaticMesh(*data);
|
mesh = new StaticMesh(data.get());
|
||||||
delete data;
|
|
||||||
|
|
||||||
for (std::size_t i = 0; i < mesh->materials.size(); i++) {
|
for (std::size_t i = 0; i < mesh->materials.size(); i++) {
|
||||||
mesh->materials[i]->ambient /= 2.0F;
|
mesh->materials[i]->ambient /= 2.0F;
|
||||||
|
|||||||
@@ -23,11 +23,10 @@ Skybox::Skybox(TextureRepository* repo) {
|
|||||||
objOptions.flipUVs = true;
|
objOptions.flipUVs = true;
|
||||||
objOptions.scale = 100.0F;
|
objOptions.scale = 100.0F;
|
||||||
|
|
||||||
auto* data = loader.load(FileUtils::fromCwd("game/models/skybox/skybox.obj"),
|
auto data = loader.load(FileUtils::fromCwd("game/models/skybox/skybox.obj"),
|
||||||
objOptions);
|
objOptions);
|
||||||
data->normalsEnabled = false;
|
data->normalsEnabled = false;
|
||||||
mesh = new StaticMesh(*data);
|
mesh = new StaticMesh(data.get());
|
||||||
delete data;
|
|
||||||
|
|
||||||
repo->addByMesh(mesh, FileUtils::fromCwd("game/models/skybox/"), "png");
|
repo->addByMesh(mesh, FileUtils::fromCwd("game/models/skybox/"), "png");
|
||||||
|
|
||||||
|
|||||||
@@ -27,11 +27,11 @@ Terrain::Terrain(TextureRepository* repo)
|
|||||||
objOptions.flipUVs = true;
|
objOptions.flipUVs = true;
|
||||||
objOptions.scale = 100.0F;
|
objOptions.scale = 100.0F;
|
||||||
|
|
||||||
auto* data = loader.load(
|
auto data = loader.load(FileUtils::fromCwd("game/models/terrain/terrain.obj"),
|
||||||
FileUtils::fromCwd("game/models/terrain/terrain.obj"), objOptions);
|
objOptions);
|
||||||
data->normalsEnabled = false;
|
data->normalsEnabled = false;
|
||||||
mesh = new StaticMesh(*data);
|
mesh = new StaticMesh(data.get());
|
||||||
delete data;
|
|
||||||
repo->addByMesh(mesh, FileUtils::fromCwd("game/models/terrain/"), "png");
|
repo->addByMesh(mesh, FileUtils::fromCwd("game/models/terrain/"), "png");
|
||||||
|
|
||||||
allocateOptions();
|
allocateOptions();
|
||||||
|
|||||||
Reference in New Issue
Block a user