This commit is contained in:
Artem Budarin 2018-08-13 21:24:04 +05:00
parent 4e35c0e218
commit 18311301c4
6 changed files with 92 additions and 50 deletions

35
game/Sounds.cpp Executable file
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();
}

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;
});
}
}
}

View File

@ -29,26 +29,12 @@
74EEBAF11E2D1C7C004C6C65 /* CustomGLKView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74EEBAF01E2D1C7C004C6C65 /* CustomGLKView.swift */; };
841270C91E639C2F00776DAE /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 841270C81E639C2F00776DAE /* Images.xcassets */; };
841D49651E65981600C85722 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 841D49641E65981600C85722 /* LaunchScreen.storyboard */; };
84D0FEBE1E274DDD00EC3FE5 /* libSalmon Engine.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4C902A7815C5735700FBC901 /* libSalmon Engine.a */; };
84D0FEC91E274E4A00EC3FE5 /* libvorbis-tremor-ios.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 84D0FEC61E274E3700EC3FE5 /* libvorbis-tremor-ios.a */; };
84D0FECC1E274EBC00EC3FE5 /* main_code.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84D0FECA1E274EBC00EC3FE5 /* main_code.cpp */; };
ACA00EED21216E2E00DEC93B /* libTesEngine.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ACA00EE221216C8100DEC93B /* libTesEngine.a */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
4C902A7715C5735700FBC901 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 4C902A7015C5735500FBC901 /* Salmon Engine.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 4C8CE90215B0A0F400078175;
remoteInfo = "Salmon Engine";
};
84D0FEBF1E274DF700EC3FE5 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 4C902A7015C5735500FBC901 /* Salmon Engine.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 4C8CE90115B0A0F400078175;
remoteInfo = "Salmon Engine";
};
84D0FEC51E274E3700EC3FE5 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 84D0FEC11E274E3700EC3FE5 /* vorbis-tremor-ios.xcodeproj */;
@ -63,6 +49,20 @@
remoteGlobalIDString = 4C77827C15BAB67E003D5142;
remoteInfo = "vorbis-tremor-ios";
};
ACA00EE121216C8100DEC93B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = ACA00EDD21216C8000DEC93B /* TesEngine.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 4C8CE90215B0A0F400078175;
remoteInfo = TesEngine;
};
ACA00EEE21216E4800DEC93B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = ACA00EDD21216C8000DEC93B /* TesEngine.xcodeproj */;
proxyType = 1;
remoteGlobalIDString = 4C8CE90115B0A0F400078175;
remoteInfo = TesEngine;
};
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
@ -80,7 +80,6 @@
4C77831415BABD8B003D5142 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
4C77831515BABD8B003D5142 /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; };
4C7AD44B15B1D77700A599F6 /* ios_api.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ios_api.cpp; sourceTree = "<group>"; };
4C902A7015C5735500FBC901 /* Salmon Engine.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "Salmon Engine.xcodeproj"; path = "../../Engine/iOS/Salmon Engine/Salmon Engine.xcodeproj"; sourceTree = "<group>"; };
4CCC0ECD15B310FB005432FB /* ios_api.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ios_api.h; sourceTree = "<group>"; };
4CE6A9D115B2F979006A3965 /* assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = assets; path = ../assets; sourceTree = "<group>"; };
74AC9EBB1E2CE407003C9749 /* salmontemplate-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "salmontemplate-Bridging-Header.h"; sourceTree = "<group>"; };
@ -103,6 +102,7 @@
84D0FEC11E274E3700EC3FE5 /* vorbis-tremor-ios.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "vorbis-tremor-ios.xcodeproj"; path = "../../libs/vorbis-tremor-ios/vorbis-tremor-ios.xcodeproj"; sourceTree = "<group>"; };
84D0FECA1E274EBC00EC3FE5 /* main_code.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = main_code.cpp; path = ../game/main_code.cpp; sourceTree = "<group>"; };
84D0FECB1E274EBC00EC3FE5 /* main_code.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = main_code.h; path = ../game/main_code.h; sourceTree = "<group>"; };
ACA00EDD21216C8000DEC93B /* TesEngine.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = TesEngine.xcodeproj; path = "../../tes-engine/iOS/TesEngine/TesEngine.xcodeproj"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -110,8 +110,8 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
ACA00EED21216E2E00DEC93B /* libTesEngine.a in Frameworks */,
84D0FEC91E274E4A00EC3FE5 /* libvorbis-tremor-ios.a in Frameworks */,
84D0FEBE1E274DDD00EC3FE5 /* libSalmon Engine.a in Frameworks */,
4C77831815BABE26003D5142 /* AudioToolbox.framework in Frameworks */,
4C77831915BABE26003D5142 /* OpenAL.framework in Frameworks */,
4C49B2BE15B0991B003512CD /* UIKit.framework in Frameworks */,
@ -128,8 +128,8 @@
4C49B2AE15B0991B003512CD = {
isa = PBXGroup;
children = (
ACA00EDD21216C8000DEC93B /* TesEngine.xcodeproj */,
84D0FEC11E274E3700EC3FE5 /* vorbis-tremor-ios.xcodeproj */,
4C902A7015C5735500FBC901 /* Salmon Engine.xcodeproj */,
4C7B819515C40F770024D61A /* Libs */,
4CC1FC3415B200130025C6F7 /* Resources */,
4C49B2C715B0991B003512CD /* Sources */,
@ -197,14 +197,6 @@
name = Libs;
sourceTree = "<group>";
};
4C902A7115C5735500FBC901 /* Products */ = {
isa = PBXGroup;
children = (
4C902A7815C5735700FBC901 /* libSalmon Engine.a */,
);
name = Products;
sourceTree = "<group>";
};
4CC1FC3415B200130025C6F7 /* Resources */ = {
isa = PBXGroup;
children = (
@ -240,6 +232,14 @@
name = Products;
sourceTree = "<group>";
};
ACA00EDE21216C8000DEC93B /* Products */ = {
isa = PBXGroup;
children = (
ACA00EE221216C8100DEC93B /* libTesEngine.a */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@ -254,8 +254,8 @@
buildRules = (
);
dependencies = (
ACA00EEF21216E4800DEC93B /* PBXTargetDependency */,
84D0FEC81E274E3F00EC3FE5 /* PBXTargetDependency */,
84D0FEC01E274DF700EC3FE5 /* PBXTargetDependency */,
);
name = "Double Hit Balls";
productName = doublehitballs;
@ -289,8 +289,8 @@
projectDirPath = "";
projectReferences = (
{
ProductGroup = 4C902A7115C5735500FBC901 /* Products */;
ProjectRef = 4C902A7015C5735500FBC901 /* Salmon Engine.xcodeproj */;
ProductGroup = ACA00EDE21216C8000DEC93B /* Products */;
ProjectRef = ACA00EDD21216C8000DEC93B /* TesEngine.xcodeproj */;
},
{
ProductGroup = 84D0FEC21E274E3700EC3FE5 /* Products */;
@ -305,13 +305,6 @@
/* End PBXProject section */
/* Begin PBXReferenceProxy section */
4C902A7815C5735700FBC901 /* libSalmon Engine.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libSalmon Engine.a";
remoteRef = 4C902A7715C5735700FBC901 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
84D0FEC61E274E3700EC3FE5 /* libvorbis-tremor-ios.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
@ -319,6 +312,13 @@
remoteRef = 84D0FEC51E274E3700EC3FE5 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
ACA00EE221216C8100DEC93B /* libTesEngine.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libTesEngine.a;
remoteRef = ACA00EE121216C8100DEC93B /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */
/* Begin PBXResourcesBuildPhase section */
@ -358,16 +358,16 @@
/* End PBXSourcesBuildPhase section */
/* Begin PBXTargetDependency section */
84D0FEC01E274DF700EC3FE5 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "Salmon Engine";
targetProxy = 84D0FEBF1E274DF700EC3FE5 /* PBXContainerItemProxy */;
};
84D0FEC81E274E3F00EC3FE5 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "vorbis-tremor-ios";
targetProxy = 84D0FEC71E274E3F00EC3FE5 /* PBXContainerItemProxy */;
};
ACA00EEF21216E4800DEC93B /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = TesEngine;
targetProxy = ACA00EEE21216E4800DEC93B /* PBXContainerItemProxy */;
};
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
@ -504,15 +504,16 @@
GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = "";
"GCC_THUMB_SUPPORT[arch=armv6]" = "";
HEADER_SEARCH_PATHS = (
../../engine,
"../../tes-engine",
../../libs/lpng1510,
../../libs/sqplus/sqplus,
../../libs/sqplus/include,
../../boost_1_63_0,
../../boost_1_67_0,
../game,
"../../libs/vorbis-tremor-ios/vorbis",
"../../libs/jpeg-9",
"../../libs/jpeg-9/vc10",
../../eigen,
);
INFOPLIST_FILE = "template-Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
@ -551,15 +552,16 @@
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
"GCC_THUMB_SUPPORT[arch=armv6]" = "";
HEADER_SEARCH_PATHS = (
../../engine,
"../../tes-engine",
../../libs/lpng1510,
../../libs/sqplus/sqplus,
../../libs/sqplus/include,
../../boost_1_63_0,
../../boost_1_67_0,
../game,
"../../libs/vorbis-tremor-ios/vorbis",
"../../libs/jpeg-9",
"../../libs/jpeg-9/vc10",
../../eigen,
);
INFOPLIST_FILE = "template-Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";

View File

@ -95,6 +95,11 @@
"idiom" : "ipad",
"filename" : "Icon-167.png",
"scale" : "2x"
},
{
"idiom" : "ios-marketing",
"size" : "1024x1024",
"scale" : "1x"
}
],
"info" : {

View File

@ -48,8 +48,8 @@ void SE_AppOnTapUpAfterMove(int posx, int posy, int touchNumber) {
SE::AppOnTapUpAfterMove(posx, posy, touchNumber);
}
void SE_AppOnScroll(int shiftx, int shifty, int touchNumber) {
SE::AppOnScroll(shiftx, shifty, touchNumber);
void SE_AppOnScroll(int posx, int posy, int shiftx, int shifty, int touchNumber) {
SE::AppOnScroll(posx, posy, shiftx, shifty, touchNumber);
}
void SE_AppOnScale(float scale) {

View File

@ -4,5 +4,5 @@
extern "C" void CustomAppInit()
{
AppInit<TAndroidApplication>(480, 320);
AppInit<TMyApplication>(480, 320, 480, 320);
}