add sounds

This commit is contained in:
artem.budarin committed 2018-08-13 13:16:06 +05:00
1 parent fe73d7bec9
commit 26b6632158
13 files changed
+123 -21

No files matched your search

Executable
+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_com_fishrungames_crystalofrhylil_sounds_JniSoundCalls_initJniSounds(JNIEnv *pEnv, jobject pThis) {
env = pEnv;
jSounds = env->FindClass("com/fishrungames/crystalofrhyli/sounds/JniSoundCalls");
playBackgroundSound();
}
Executable
+7
View File
@@ -0,0 +1,7 @@
#include <jni.h>
extern "C" {
JNIEXPORT void JNICALL Java_com_fishrungames_crystalofrhylil_sounds_JniSoundCalls_initJniSounds(JNIEnv *pEnv, jobject pThis);
}
+21 -21
View File
@@ -74,27 +74,27 @@ void TMyApplication::InnerInit()
*SE::Console << "APP INIT\n";
}
SE::ResourceManager->ShaderManager.AddShader("DefaultShader", "shader1vertex.txt", "shader1fragment.txt");
SE::ResourceManager->ShaderManager.AddShader("FrameShader", "frameshader_vertex.txt", "frameshader_fragment.txt");
SE::ResourceManager->ShaderManager.AddShader("BrickShader", "brickshader_vertex.txt", "brickshader_fragment.txt");
SE::Renderer->PushShader("DefaultShader");
const std::string CONST_LOADING_BACKGROUND_BLACK = "loading_background_black";
const std::string CONST_LOADING_TEXTURE = "loading";
const std::string CONST_LOGO_SMALL_TEXTURE = "logo_small";
SE::ResourceManager->TexList.AddTexture(CONST_LOADING_BACKGROUND_BLACK + ".png", CONST_LOADING_BACKGROUND_BLACK);
SE::ResourceManager->TexList.AddTexture(CONST_LOADING_TEXTURE + ".png", CONST_LOADING_TEXTURE);
SE::ResourceManager->TexList.AddTexture(CONST_LOGO_SMALL_TEXTURE + ".png", CONST_LOGO_SMALL_TEXTURE);
SE::ResourceManager->TexList.AddTexture("console_bkg.bmp");
SE::ResourceManager->FrameManager.AddFrameRenderBuffer("LevelBuffer", 512, 512);
Inited = true;
SE::Renderer->SetOrthoProjection();
SE::ResourceManager->ShaderManager.AddShader("DefaultShader", "shader_vertex.txt", "shader_fragment.txt");
SE::ResourceManager->ShaderManager.AddShader("FrameShader", "frameshader_vertex.txt", "frameshader_fragment.txt");
SE::ResourceManager->ShaderManager.AddShader("BrickShader", "brickshader_vertex.txt", "brickshader_fragment.txt");
SE::Renderer->PushShader("DefaultShader");
const std::string CONST_LOADING_BACKGROUND_BLACK = "loading_background_black";
const std::string CONST_LOADING_TEXTURE = "loading";
const std::string CONST_LOGO_SMALL_TEXTURE = "logo_small";
SE::ResourceManager->TexList.AddTexture(CONST_LOADING_BACKGROUND_BLACK + ".png", CONST_LOADING_BACKGROUND_BLACK);
SE::ResourceManager->TexList.AddTexture(CONST_LOADING_TEXTURE + ".png", CONST_LOADING_TEXTURE);
SE::ResourceManager->TexList.AddTexture(CONST_LOGO_SMALL_TEXTURE + ".png", CONST_LOGO_SMALL_TEXTURE);
SE::ResourceManager->TexList.AddTexture("console_bkg.bmp");
SE::ResourceManager->FrameManager.AddFrameRenderBuffer("LevelBuffer", 512, 512);
Inited = true;
SE::Renderer->SetOrthoProjection();
SE::Renderer->SetFullScreenViewport();