Assumptes #1 al #6 finiquitats. Piràmide secreta funcionant, amb la seua intro.

This commit is contained in:
2016-02-22 17:52:49 +01:00
parent f00afcf9a2
commit de9bac2b2c
12 changed files with 188 additions and 34 deletions

View File

@@ -1,11 +1,14 @@
#include "jsound.h"
#include "jfile.h"
#include <string>
Mix_Music *music = NULL;
char currentMusic[12];
bool JS_Init() {
Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, MIX_DEFAULT_FORMAT, 2, 1024);
Mix_AllocateChannels(8);
currentMusic[0] = 0;
return true;
}
@@ -22,6 +25,7 @@ void JS_LoadMusic(const char *musicFilename)
SDL_RWops *rw = SDL_RWFromMem(buffer, filesize);
music = Mix_LoadMUS_RW(rw, 1);
strcpy(currentMusic, musicFilename);
}
void JS_SetMusicVolume(int volume) {
@@ -44,6 +48,10 @@ bool JS_MusicPlaying() {
return (Mix_PlayingMusic() == 1);// && (Mix_FadingMusic() != MIX_FADING_OUT);
}
const char* JS_GetMusicName() {
return currentMusic;
}
JS_Sound *JS_LoadSound(char *soundFilename) {
int filesize = 0;
char *buffer = JF_GetBufferFromResource(soundFilename, filesize);