still no sound yet, but progress
This commit is contained in:
parent
4120d4b8ec
commit
1ed878494f
2 changed files with 6 additions and 4 deletions
|
@ -5,6 +5,7 @@ int soundListenerX;
|
|||
int soundListenerY;
|
||||
|
||||
void loadSound(Sound * snd, char * filename){
|
||||
romfsInit();
|
||||
FILE *file = fopen(filename, "rb");
|
||||
if(file != NULL){
|
||||
fseek(file, 0, SEEK_END);
|
||||
|
@ -14,6 +15,7 @@ void loadSound(Sound * snd, char * filename){
|
|||
fread(snd->buffer, 1, snd->size, file);
|
||||
}
|
||||
fclose(file);
|
||||
romfsExit();
|
||||
}
|
||||
|
||||
void playSound(Sound snd){
|
||||
|
@ -70,8 +72,7 @@ void updateMusic(int lvl, int time) {
|
|||
}
|
||||
|
||||
void loadSounds() {
|
||||
Result rc = romfsInit();
|
||||
loadSound(&snd_playerHurt, "romfs:/resources/playerhurt.raw");
|
||||
loadSound(&snd_playerHurt, "resources/playerhurt.raw");
|
||||
loadSound(&snd_playerDeath, "resources/playerdeath.raw");
|
||||
loadSound(&snd_monsterHurt, "resources/monsterhurt.raw");
|
||||
loadSound(&snd_test, "resources/test.raw");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue