This commit is contained in:
artem.budarin committed 2018-08-13 21:24:04 +05:00
1 parent 4e35c0e218
commit 18311301c4
6 files changed
+92 -50

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
#include "Sounds.h"
#include <jni.h>
static JNIEnv* env = NULL;
static jclass jSounds = NULL;
/** BackgroundSound */
void playBackgroundSound() {
jmethodID method = env->GetStaticMethodID(jSounds, "JniPlayBackgroundSound", "()V");
env->CallStaticVoidMethod(jSounds, method);
}
void stopBackgroundSound () {
jmethodID method = env->GetStaticMethodID(jSounds, "JniStopBackgroundSound", "()V");
env->CallStaticVoidMethod(jSounds, method);
}
/** GameSound - Gunshot */
void playGameSoundGunshot() {
jmethodID method = env->GetStaticMethodID(jSounds, "JniPlayGunshotSound", "()V");
env->CallStaticVoidMethod(jSounds, method);
}
void stopGameSoundGunshot() {
jmethodID method = env->GetStaticMethodID(jSounds, "JniStopGunshotSound", "()V");
env->CallStaticVoidMethod(jSounds, method);
}
JNIEXPORT void JNICALL Java_fishrungames_doublehitballs_sounds_JniSoundCalls_initJniSounds(JNIEnv *pEnv, jobject pThis) {
env = pEnv;
jSounds = env->FindClass("fishrungames/doublehitballs/sounds/JniSoundCalls");
playBackgroundSound();
}
+2 -2
View File
@@ -359,7 +359,7 @@ void TMyApplication::LoadResources()
TextureNamesToLoad.push_back(std::pair<std::string, std::string>(CONST_CREDITS_TEXTURE + ".png", CONST_CREDITS_TEXTURE));
#ifdef TARGET_IOS
ResourceManager->SoundManager.LoadMusicLooped("level1ogg.ogg");
//ResourceManager->SoundManager.LoadMusicLooped("level1ogg.ogg");
#else
//ResourceManager->SoundManager.LoadMusic("level1ogg.ogg");
#endif
@@ -733,4 +733,4 @@ void TMyApplication::SetButtonsAction () {
this->GameLevel->PrevLevelStateIsStandby = true;
});
}
}
}