fixing rendering issue on real PS2
This commit is contained in:
@@ -52,5 +52,14 @@ all: $(EE_BIN)
|
||||
clean:
|
||||
rm -f $(EE_OBJS)
|
||||
|
||||
run: $(EE_BIN)
|
||||
killall -v ps2client || true
|
||||
ps2client reset
|
||||
ps2client reset
|
||||
$(EE_STRIP) --strip-all $(EE_BIN)
|
||||
mv $(EE_BIN) bin/$(EE_BIN)
|
||||
rm $(EE_OBJS)
|
||||
cd bin/ && ps2client execee host:$(EE_BIN)
|
||||
|
||||
include $(PS2SDK)/samples/Makefile.pref
|
||||
include $(PS2SDK)/samples/Makefile.eeglobal
|
||||
|
||||
+31
-29
@@ -32,12 +32,10 @@ Ari::~Ari() {}
|
||||
|
||||
void Ari::onInit()
|
||||
{
|
||||
|
||||
engine->renderer->setCameraDefinitions(&camera.worldView, &camera.position, camera.planes);
|
||||
engine->audio.init(0);
|
||||
engine->audio.setVolume(40);
|
||||
engine->audio.loadSong("MOV-CIRC.WAV");
|
||||
engine->audio.play();
|
||||
|
||||
texRepo = engine->renderer->getTextureRepository();
|
||||
|
||||
@@ -52,31 +50,35 @@ void Ari::onInit()
|
||||
islandAddons.rotation.x = -1.6F;
|
||||
islandAddons.position.set(0.0F, 10.0F, 20.0F);
|
||||
|
||||
skybox.loadObj("skybox/", "skybox", 100.0F, false);
|
||||
skybox.shouldBeFrustumCulled = false;
|
||||
// skybox.loadObj("skybox/", "skybox", 100.0F, false);
|
||||
// skybox.shouldBeFrustumCulled = false;
|
||||
|
||||
waterFloors[0].loadObj("water/", "water", 5.0F, false);
|
||||
waterFloors[0].position.set(0.0F, 8.0F, 0.0F);
|
||||
texRepo->addByMesh("water/", waterFloors[0]);
|
||||
for (u8 i = 0; i < WATER_TILES_COUNT; i++)
|
||||
{
|
||||
spirals[i].x = 1.0F;
|
||||
spirals[i].y = 2.0F;
|
||||
}
|
||||
u32 spiralOffset = (u32)Math::sqrt(WATER_TILES_COUNT);
|
||||
calcSpiral(spiralOffset, spiralOffset);
|
||||
for (u8 i = 1; i < WATER_TILES_COUNT; i++)
|
||||
{
|
||||
waterFloors[i].loadFrom(waterFloors[0]);
|
||||
waterFloors[i].position.set(10.0F * spirals[i].x, 8.0F, 10.0F * spirals[i].y);
|
||||
texRepo->getByMesh(waterFloors[0].getId(), waterFloors[0].getMaterial(0).getId())
|
||||
->addLink(waterFloors[i].getId(), waterFloors[i].getMaterial(0).getId());
|
||||
}
|
||||
// waterFloors[0].loadObj("water/", "water", 5.0F, false);
|
||||
// waterFloors[0].position.set(0.0F, 8.0F, 0.0F);
|
||||
// texRepo->addByMesh("water/", waterFloors[0]);
|
||||
// for (u8 i = 0; i < WATER_TILES_COUNT; i++)
|
||||
// {
|
||||
// spirals[i].x = 1.0F;
|
||||
// spirals[i].y = 2.0F;
|
||||
// }
|
||||
// u32 spiralOffset = (u32)Math::sqrt(WATER_TILES_COUNT);
|
||||
// calcSpiral(spiralOffset, spiralOffset);
|
||||
// for (u8 i = 1; i < WATER_TILES_COUNT; i++)
|
||||
// {
|
||||
// waterFloors[i].loadFrom(waterFloors[0]);
|
||||
// waterFloors[i].position.set(10.0F * spirals[i].x, 8.0F, 10.0F * spirals[i].y);
|
||||
// texRepo->getByMesh(waterFloors[0].getId(), waterFloors[0].getMaterial(0).getId())
|
||||
// ->addLink(waterFloors[i].getId(), waterFloors[i].getMaterial(0).getId());
|
||||
// }
|
||||
|
||||
texRepo->addByMesh("sunnyisl/", island);
|
||||
texRepo->addByMesh("sunnyisl/", islandAddons);
|
||||
texRepo->addByMesh("skybox/", skybox);
|
||||
texRepo->addByMesh("ari/", player.mesh);
|
||||
// texRepo->addByMesh("sunnyisl/", islandAddons);
|
||||
|
||||
// texRepo->addByMesh("skybox/", skybox);
|
||||
|
||||
// texRepo->addByMesh("ari/", player.mesh);
|
||||
|
||||
// engine->audio.play();
|
||||
}
|
||||
|
||||
void Ari::initBulb()
|
||||
@@ -90,12 +92,12 @@ void Ari::onUpdate()
|
||||
if (engine->pad.isCrossClicked)
|
||||
printf("FPS:%f\n", engine->fps);
|
||||
camera.update(engine->pad, player.mesh);
|
||||
engine->renderer->draw(skybox);
|
||||
// engine->renderer->draw(skybox);
|
||||
engine->renderer->draw(island);
|
||||
engine->renderer->draw(islandAddons);
|
||||
engine->renderer->draw(player.mesh);
|
||||
for (u8 i = 0; i < WATER_TILES_COUNT; i++)
|
||||
engine->renderer->draw(waterFloors[i]);
|
||||
// engine->renderer->draw(islandAddons);
|
||||
// engine->renderer->draw(player.mesh);
|
||||
// for (u8 i = 0; i < WATER_TILES_COUNT; i++)
|
||||
// engine->renderer->draw(waterFloors[i]);
|
||||
}
|
||||
|
||||
void Ari::calcSpiral(int X, int Y)
|
||||
|
||||
@@ -22,16 +22,16 @@
|
||||
|
||||
Player::Player()
|
||||
{
|
||||
PRINT_LOG("Creating player object");
|
||||
this->gravity = 0.1F;
|
||||
this->lift = -1.0F;
|
||||
this->mesh.loadMD2("ari/", "ari", 0.0001F, true);
|
||||
this->mesh.position.set(0.0F, 10.0F, 0.0F);
|
||||
this->mesh.shouldBeBackfaceCulled = true;
|
||||
this->mesh.shouldBeFrustumCulled = false;
|
||||
this->mesh.shouldBeLighted = true;
|
||||
this->mesh.setAnimSpeed(0.05F);
|
||||
this->mesh.playAnimation(0, 1);
|
||||
// PRINT_LOG("Creating player object");
|
||||
// this->gravity = 0.1F;
|
||||
// this->lift = -1.0F;
|
||||
// this->mesh.loadMD2("ari/", "ari", 0.0001F, true);
|
||||
// this->mesh.position.set(0.0F, 10.0F, 0.0F);
|
||||
// this->mesh.shouldBeBackfaceCulled = true;
|
||||
// this->mesh.shouldBeFrustumCulled = false;
|
||||
// this->mesh.shouldBeLighted = true;
|
||||
// this->mesh.setAnimSpeed(0.05F);
|
||||
// this->mesh.playAnimation(0, 1);
|
||||
PRINT_LOG("Player object created!");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user