minor fixes
This commit is contained in:
@@ -117,7 +117,7 @@ audsrv_adpcm_t *Audio::loadADPCM(char *t_path)
|
|||||||
char *fullFilename = String::createConcatenated("host:", t_path);
|
char *fullFilename = String::createConcatenated("host:", t_path);
|
||||||
FILE *file = fopen(fullFilename, "rb");
|
FILE *file = fopen(fullFilename, "rb");
|
||||||
delete[] fullFilename;
|
delete[] fullFilename;
|
||||||
fseek(file, 0L, SEEK_END);
|
fseek(file, 0, SEEK_END);
|
||||||
u32 adpcmFileSize = ftell(file);
|
u32 adpcmFileSize = ftell(file);
|
||||||
u8 data[adpcmFileSize];
|
u8 data[adpcmFileSize];
|
||||||
rewind(file);
|
rewind(file);
|
||||||
|
|||||||
@@ -83,8 +83,8 @@ void VifSender::drawMesh(RenderData *t_renderData, Matrix t_perspective, u32 ver
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
vu_add_end_tag(currPacket);
|
vu_add_end_tag(currPacket);
|
||||||
dma_channel_wait(DMA_CHANNEL_VIF1, 0);
|
|
||||||
dma_channel_send_packet2(currPacket, DMA_CHANNEL_VIF1, 1);
|
dma_channel_send_packet2(currPacket, DMA_CHANNEL_VIF1, 1);
|
||||||
|
dma_channel_wait(DMA_CHANNEL_VIF1, 0);
|
||||||
context = !context;
|
context = !context;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -117,7 +117,7 @@ void VifSender::drawVertices(Mesh &t_mesh, u32 t_start, u32 t_end, VECTOR *t_ver
|
|||||||
for (u8 j = 0; j < 4; j++)
|
for (u8 j = 0; j < 4; j++)
|
||||||
vu_unpack_add_u32(currPacket, 128);
|
vu_unpack_add_u32(currPacket, 128);
|
||||||
|
|
||||||
//// Clipping tests start
|
// Clipping tests start
|
||||||
|
|
||||||
// // const float minZ = 1;
|
// // const float minZ = 1;
|
||||||
// // const float maxZ = 65535;
|
// // const float maxZ = 65535;
|
||||||
|
|||||||
+11
-8
@@ -34,8 +34,12 @@ void Ari::onInit()
|
|||||||
{
|
{
|
||||||
engine->renderer->setCameraDefinitions(&camera.worldView, &camera.position, camera.planes);
|
engine->renderer->setCameraDefinitions(&camera.worldView, &camera.position, camera.planes);
|
||||||
engine->audio.setSongVolume(40);
|
engine->audio.setSongVolume(40);
|
||||||
engine->audio.loadSong("MOV-CIRC.WAV");
|
// engine->audio.loadSong("MOV-CIRC.WAV");
|
||||||
adpcm = engine->audio.loadADPCM("ziobro.adpcm");
|
engine->audio.loadSong("nob-else.wav");
|
||||||
|
|
||||||
|
adpcm1 = engine->audio.loadADPCM("ziobro1.adpcm");
|
||||||
|
adpcm2 = engine->audio.loadADPCM("ziobro2.adpcm");
|
||||||
|
|
||||||
texRepo = engine->renderer->getTextureRepository();
|
texRepo = engine->renderer->getTextureRepository();
|
||||||
engine->renderer->disableVSync();
|
engine->renderer->disableVSync();
|
||||||
island.loadDff("sunnyisl/", "sunnyisl", 0.1F, false);
|
island.loadDff("sunnyisl/", "sunnyisl", 0.1F, false);
|
||||||
@@ -72,11 +76,8 @@ void Ari::onInit()
|
|||||||
|
|
||||||
texRepo->addByMesh("sunnyisl/", island);
|
texRepo->addByMesh("sunnyisl/", island);
|
||||||
texRepo->addByMesh("sunnyisl/", islandAddons);
|
texRepo->addByMesh("sunnyisl/", islandAddons);
|
||||||
|
|
||||||
texRepo->addByMesh("skybox/", skybox);
|
texRepo->addByMesh("skybox/", skybox);
|
||||||
|
|
||||||
texRepo->addByMesh("ari/", player.mesh);
|
texRepo->addByMesh("ari/", player.mesh);
|
||||||
|
|
||||||
engine->audio.playSong();
|
engine->audio.playSong();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,17 +91,19 @@ void Ari::onUpdate()
|
|||||||
{
|
{
|
||||||
if (engine->pad.isCrossClicked)
|
if (engine->pad.isCrossClicked)
|
||||||
{
|
{
|
||||||
engine->audio.loadSong("nob-else.wav");
|
// engine->audio.loadSong("nob-else.wav");
|
||||||
engine->audio.playADPCM(adpcm);
|
engine->audio.playADPCM(adpcm1);
|
||||||
printf("FPS:%f\n", engine->fps);
|
printf("FPS:%f\n", engine->fps);
|
||||||
}
|
}
|
||||||
|
if (engine->pad.isCircleClicked)
|
||||||
|
engine->audio.playADPCM(adpcm2);
|
||||||
camera.update(engine->pad, player.mesh);
|
camera.update(engine->pad, player.mesh);
|
||||||
engine->renderer->draw(skybox);
|
engine->renderer->draw(skybox);
|
||||||
engine->renderer->draw(island);
|
engine->renderer->draw(island);
|
||||||
engine->renderer->draw(islandAddons);
|
engine->renderer->draw(islandAddons);
|
||||||
engine->renderer->draw(player.mesh);
|
engine->renderer->draw(player.mesh);
|
||||||
for (u8 i = 0; i < WATER_TILES_COUNT; i++)
|
for (u8 i = 0; i < WATER_TILES_COUNT; i++)
|
||||||
engine->renderer->drawByPath3(waterFloors[i]);
|
engine->renderer->draw(waterFloors[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Ari::calcSpiral(int X, int Y)
|
void Ari::calcSpiral(int X, int Y)
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ private:
|
|||||||
Player player;
|
Player player;
|
||||||
Mesh island, islandAddons, skybox;
|
Mesh island, islandAddons, skybox;
|
||||||
Mesh *waterFloors;
|
Mesh *waterFloors;
|
||||||
audsrv_adpcm_t *adpcm;
|
audsrv_adpcm_t *adpcm1, *adpcm2;
|
||||||
Point *spirals;
|
Point *spirals;
|
||||||
Camera camera;
|
Camera camera;
|
||||||
TextureRepository *texRepo;
|
TextureRepository *texRepo;
|
||||||
|
|||||||
@@ -55,5 +55,14 @@ all: $(EE_BIN)
|
|||||||
clean:
|
clean:
|
||||||
rm -f $(EE_BIN) $(EE_OBJS)
|
rm -f $(EE_BIN) $(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.pref
|
||||||
include $(PS2SDK)/samples/Makefile.eeglobal
|
include $(PS2SDK)/samples/Makefile.eeglobal
|
||||||
|
|||||||
@@ -51,9 +51,9 @@ void Floors::onUpdate()
|
|||||||
camera.update(engine->pad, player.mesh);
|
camera.update(engine->pad, player.mesh);
|
||||||
floorManager.update(player);
|
floorManager.update(player);
|
||||||
player.update(engine->pad, camera, floorManager);
|
player.update(engine->pad, camera, floorManager);
|
||||||
// engine->renderer->draw(player.mesh);
|
engine->renderer->draw(player.mesh);
|
||||||
for (u8 i = 0; i < FLOORS_COUNT; i++)
|
for (u8 i = 0; i < FLOORS_COUNT; i++)
|
||||||
engine->renderer->drawByPath3(floorManager.floors[i].mesh, lightManager.bulbs, lightManager.bulbsCount);
|
engine->renderer->draw(floorManager.floors[i].mesh, lightManager.bulbs, lightManager.bulbsCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Floors::onAudioTick()
|
void Floors::onAudioTick()
|
||||||
|
|||||||
Reference in New Issue
Block a user