Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile-Cn-Ko-En
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fallenstardust
YGOMobile-Cn-Ko-En
Commits
6abe1256
Commit
6abe1256
authored
Dec 09, 2019
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
移除native sound_effect_enable
parent
aa0b41c4
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
2 additions
and
119 deletions
+2
-119
libcore/android/android_tools.cpp
libcore/android/android_tools.cpp
+1
-32
libcore/android/android_tools.h
libcore/android/android_tools.h
+0
-6
libcore/src/main/java/cn/garymb/ygomobile/GameApplication.java
...re/src/main/java/cn/garymb/ygomobile/GameApplication.java
+1
-38
libcore/src/main/java/cn/garymb/ygomobile/NativeInitOptions.java
.../src/main/java/cn/garymb/ygomobile/NativeInitOptions.java
+0
-3
libcore/src/main/java/cn/garymb/ygomobile/core/IrrlichtBridge.java
...rc/main/java/cn/garymb/ygomobile/core/IrrlichtBridge.java
+0
-2
mobile/src/main/java/cn/garymb/ygomobile/App.java
mobile/src/main/java/cn/garymb/ygomobile/App.java
+0
-4
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
+0
-15
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
+0
-2
mobile/src/main/java/cn/garymb/ygomobile/ui/preference/fragments/SettingFragment.java
...mb/ygomobile/ui/preference/fragments/SettingFragment.java
+0
-11
mobile/src/main/res/xml/preference_game.xml
mobile/src/main/res/xml/preference_game.xml
+0
-6
No files found.
libcore/android/android_tools.cpp
View file @
6abe1256
...
...
@@ -18,13 +18,11 @@ inline static void ReadString(irr::io::path &path, char*& p) {
}
InitOptions
::
InitOptions
(
void
*
data
)
:
m_opengles_version
(
0
),
m_card_quality
(
0
),
m_font_aa_enabled
(
TRUE
),
m_se_enabled
(
TRUE
)
{
m_opengles_version
(
0
),
m_card_quality
(
0
),
m_font_aa_enabled
(
TRUE
)
{
if
(
data
!=
NULL
)
{
char
*
rawdata
=
(
char
*
)
data
;
int
tmplength
=
0
;
m_opengles_version
=
BufferIO
::
ReadInt32
(
rawdata
);
m_se_enabled
=
BufferIO
::
ReadInt32
(
rawdata
)
>
0
;
m_card_quality
=
BufferIO
::
ReadInt32
(
rawdata
);
m_font_aa_enabled
=
BufferIO
::
ReadInt32
(
rawdata
)
>
0
;
...
...
@@ -801,35 +799,6 @@ int getLocalAddr(ANDROID_APP app) {
return
addr
;
}
bool
isSoundEffectEnabled
(
ANDROID_APP
app
)
{
bool
isEnabled
=
false
;
if
(
!
app
||
!
app
->
activity
||
!
app
->
activity
->
vm
)
return
isEnabled
;
JNIEnv
*
jni
=
0
;
app
->
activity
->
vm
->
AttachCurrentThread
(
&
jni
,
NULL
);
if
(
!
jni
)
return
true
;
// Retrieves NativeActivity.
jobject
lNativeActivity
=
app
->
activity
->
clazz
;
jclass
ClassNativeActivity
=
jni
->
GetObjectClass
(
lNativeActivity
);
jmethodID
MethodGetApp
=
jni
->
GetMethodID
(
ClassNativeActivity
,
"getApplication"
,
"()Landroid/app/Application;"
);
jobject
application
=
jni
->
CallObjectMethod
(
lNativeActivity
,
MethodGetApp
);
jclass
classApp
=
jni
->
GetObjectClass
(
application
);
jmethodID
MethodCheckSE
=
jni
->
GetMethodID
(
classApp
,
"isSoundEffectEnabled"
,
"()Z"
);
jboolean
result
=
jni
->
CallBooleanMethod
(
application
,
MethodCheckSE
);
if
(
result
>
0
)
{
isEnabled
=
true
;
}
else
{
isEnabled
=
false
;
}
jni
->
DeleteLocalRef
(
ClassNativeActivity
);
jni
->
DeleteLocalRef
(
classApp
);
app
->
activity
->
vm
->
DetachCurrentThread
();
return
isEnabled
;
}
void
showAndroidComboBoxCompat
(
ANDROID_APP
app
,
bool
pShow
,
char
**
pContents
,
int
count
,
int
mode
)
{
if
(
!
app
||
!
app
->
activity
||
!
app
->
activity
->
vm
)
...
...
libcore/android/android_tools.h
View file @
6abe1256
...
...
@@ -42,9 +42,6 @@ public:
inline
bool
isFontAntiAliasEnabled
()
{
return
m_font_aa_enabled
;
}
inline
bool
isSoundEffectEnabled
()
{
return
m_se_enabled
;
}
inline
bool
isPendulumScaleEnabled
()
{
return
m_ps_enabled
;
}
...
...
@@ -68,7 +65,6 @@ private:
int
cdb_count
;
int
zip_count
;
bool
m_font_aa_enabled
;
bool
m_se_enabled
;
bool
m_ps_enabled
;
};
...
...
@@ -171,8 +167,6 @@ extern void saveSetting(ANDROID_APP app, const char* key, const char* value);
//Retrive font antialias options
extern
bool
getFontAntiAlias
(
ANDROID_APP
app
);
extern
bool
isSoundEffectEnabled
(
ANDROID_APP
app
);
//Show Android compat gui;
extern
void
showAndroidComboBoxCompat
(
ANDROID_APP
app
,
bool
pShow
,
char
**
pContents
,
int
count
,
int
mode
=
0
);
...
...
libcore/src/main/java/cn/garymb/ygomobile/GameApplication.java
View file @
6abe1256
...
...
@@ -16,18 +16,15 @@ import cn.garymb.ygomobile.core.IrrlichtBridge;
public
abstract
class
GameApplication
extends
Application
implements
IrrlichtBridge
.
IrrlichtApplication
{
private
SoundPool
mSoundEffectPool
;
private
Map
<
String
,
Integer
>
mSoundIdMap
;
private
static
GameApplication
sGameApplication
;
private
boolean
isInitSoundEffectPool
=
false
;
@Override
public
void
onCreate
()
{
super
.
onCreate
();
sGameApplication
=
this
;
// Reflection.unseal(this);
// initSoundEffectPool();
}
public
static
GameApplication
get
()
{
...
...
@@ -42,15 +39,6 @@ public abstract class GameApplication extends Application implements IrrlichtBri
@Override
public
void
onTerminate
()
{
super
.
onTerminate
();
mSoundEffectPool
.
release
();
}
public
boolean
isInitSoundEffectPool
()
{
return
isInitSoundEffectPool
;
}
protected
void
setInitSoundEffectPool
(
boolean
initSoundEffectPool
)
{
isInitSoundEffectPool
=
initSoundEffectPool
;
}
public
int
getGameWidth
(){
...
...
@@ -63,24 +51,6 @@ public abstract class GameApplication extends Application implements IrrlichtBri
public
abstract
boolean
isKeepScale
();
@SuppressWarnings
(
"deprecation"
)
public
void
initSoundEffectPool
()
{
mSoundEffectPool
=
new
SoundPool
(
2
,
AudioManager
.
STREAM_MUSIC
,
0
);
AssetManager
am
=
getAssets
();
String
[]
sounds
;
mSoundIdMap
=
new
HashMap
<
String
,
Integer
>();
try
{
sounds
=
am
.
list
(
"sound"
);
for
(
String
sound
:
sounds
)
{
String
path
=
"sound"
+
File
.
separator
+
sound
;
mSoundIdMap
.
put
(
path
,
mSoundEffectPool
.
load
(
am
.
openFd
(
path
),
1
));
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
public
abstract
NativeInitOptions
getNativeInitOptions
();
public
abstract
float
getSmallerSize
();
...
...
@@ -105,11 +75,4 @@ public abstract class GameApplication extends Application implements IrrlichtBri
*/
public
abstract
boolean
isImmerSiveMode
();
@Override
public
void
playSoundEffect
(
String
path
)
{
Integer
id
=
mSoundIdMap
.
get
(
path
);
if
(
id
!=
null
)
{
mSoundEffectPool
.
play
(
id
,
0.5f
,
0.5f
,
2
,
0
,
1.0f
);
}
}
}
libcore/src/main/java/cn/garymb/ygomobile/NativeInitOptions.java
View file @
6abe1256
...
...
@@ -11,7 +11,6 @@ public final class NativeInitOptions {
private
static
final
int
BUFFER_MAX_SIZE
=
8192
;
public
int
mOpenglVersion
;
public
boolean
mIsSoundEffectEnabled
;
//工作目录
public
String
mWorkPath
;
...
...
@@ -36,7 +35,6 @@ public final class NativeInitOptions {
public
ByteBuffer
toNativeBuffer
()
{
ByteBuffer
buffer
=
ByteBuffer
.
allocateDirect
(
BUFFER_MAX_SIZE
);
putInt
(
buffer
,
mOpenglVersion
);
putInt
(
buffer
,
mIsSoundEffectEnabled
?
1
:
0
);
putInt
(
buffer
,
mCardQuality
);
putInt
(
buffer
,
mIsFontAntiAliasEnabled
?
1
:
0
);
putInt
(
buffer
,
mIsPendulumScaleEnabled
?
1
:
0
);
...
...
@@ -57,7 +55,6 @@ public final class NativeInitOptions {
public
String
toString
()
{
return
"NativeInitOptions{"
+
"mOpenglVersion="
+
mOpenglVersion
+
", mIsSoundEffectEnabled="
+
mIsSoundEffectEnabled
+
", mWorkPath='"
+
mWorkPath
+
'\''
+
", mDbList='"
+
mDbList
+
'\''
+
", mArchiveList='"
+
mArchiveList
+
'\''
+
...
...
libcore/src/main/java/cn/garymb/ygomobile/core/IrrlichtBridge.java
View file @
6abe1256
...
...
@@ -172,8 +172,6 @@ public final class IrrlichtBridge {
float
getScreenWidth
();
float
getScreenHeight
();
void
playSoundEffect
(
String
path
);
void
runWindbot
(
String
args
);
...
...
mobile/src/main/java/cn/garymb/ygomobile/App.java
View file @
6abe1256
...
...
@@ -29,10 +29,6 @@ public class App extends GameApplication {
//初始化异常工具类
CrashHandler
crashHandler
=
CrashHandler
.
getInstance
();
crashHandler
.
init
(
getApplicationContext
());
if
(
AppsSettings
.
get
().
isSoundEffect
())
{
initSoundEffectPool
();
setInitSoundEffectPool
(
true
);
}
//初始化图片选择器
initImgsel
();
//初始化bugly
...
...
mobile/src/main/java/cn/garymb/ygomobile/AppsSettings.java
View file @
6abe1256
...
...
@@ -197,7 +197,6 @@ public class AppsSettings {
options
.
mCardQuality
=
getCardQuality
();
options
.
mIsFontAntiAliasEnabled
=
isFontAntiAlias
();
options
.
mIsPendulumScaleEnabled
=
isPendulumScale
();
options
.
mIsSoundEffectEnabled
=
isSoundEffect
();
options
.
mOpenglVersion
=
getOpenglVersion
();
if
(
Constants
.
DEBUG
)
{
Log
.
i
(
"Irrlicht"
,
"option="
+
options
);
...
...
@@ -262,20 +261,6 @@ public class AppsSettings {
}
}
/***
* 音效
*/
public
boolean
isSoundEffect
()
{
return
mSharedPreferences
.
getBoolean
(
Constants
.
PREF_SOUND_EFFECT
,
Constants
.
PREF_DEF_SOUND_EFFECT
);
}
/***
* 音效
*/
public
void
setSoundEffect
(
boolean
soundEffect
)
{
mSharedPreferences
.
putBoolean
(
Constants
.
PREF_SOUND_EFFECT
,
soundEffect
);
}
/***
* 决斗助手
*/
...
...
mobile/src/main/java/cn/garymb/ygomobile/Constants.java
View file @
6abe1256
...
...
@@ -28,8 +28,6 @@ public interface Constants {
int
PREF_DEF_OPENGL_VERSION
=
1
;
String
PREF_PENDULUM_SCALE
=
"pref_key_game_lab_pendulum_scale"
;
boolean
PREF_DEF_PENDULUM_SCALE
=
true
;
String
PREF_SOUND_EFFECT
=
"pref_key_game_sound_effect"
;
boolean
PREF_DEF_SOUND_EFFECT
=
true
;
String
PREF_START_SERVICEDUELASSISTANT
=
"pref_key_start_serviceduelassistant"
;
boolean
PREF_DEF_START_SERVICEDUELASSISTANT
=
false
;
String
PREF_LOCK_SCREEN
=
"pref_key_game_screen_orientation"
;
...
...
mobile/src/main/java/cn/garymb/ygomobile/ui/preference/fragments/SettingFragment.java
View file @
6abe1256
...
...
@@ -70,7 +70,6 @@ import static cn.garymb.ygomobile.Constants.PREF_OPENGL_VERSION;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_PENDULUM_SCALE
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_READ_EX
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_SENSOR_REFRESH
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_SOUND_EFFECT
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_START_SERVICEDUELASSISTANT
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
PREF_USE_EXTRA_CARD_CARDS
;
import
static
cn
.
garymb
.
ygomobile
.
Constants
.
SETTINGS_AVATAR
;
...
...
@@ -125,7 +124,6 @@ public class SettingFragment extends PreferenceFragmentPlus {
bind
(
PREF_CHANGE_LOG
,
SystemUtils
.
getVersionName
(
getActivity
())
+
"("
+
SystemUtils
.
getVersion
(
getActivity
())
+
")"
);
bind
(
PREF_CHECK_UPDATE
,
getString
(
R
.
string
.
settings_about_author_pref
)
+
" : "
+
getString
(
R
.
string
.
settings_author
));
bind
(
PREF_SOUND_EFFECT
,
mSettings
.
isSoundEffect
());
bind
(
PREF_START_SERVICEDUELASSISTANT
,
mSettings
.
isServiceDuelAssistant
());
bind
(
PREF_LOCK_SCREEN
,
mSettings
.
isLockSreenOrientation
());
bind
(
PREF_FONT_ANTIALIAS
,
mSettings
.
isFontAntiAlias
());
...
...
@@ -199,15 +197,6 @@ public class SettingFragment extends PreferenceFragmentPlus {
getActivity
().
stopService
(
new
Intent
(
getActivity
(),
ServiceDuelAssistant
.
class
));
}
}
//如果是音效开关
if
(
preference
.
getKey
().
equals
(
PREF_SOUND_EFFECT
))
{
//如果打勾开启音效
if
(
checkBoxPreference
.
isChecked
())
{
//如果未初始化音效
if
(
App
.
get
().
isInitSoundEffectPool
())
App
.
get
().
initSoundEffectPool
();
}
}
return
true
;
}
boolean
rs
=
super
.
onPreferenceChange
(
preference
,
value
);
...
...
mobile/src/main/res/xml/preference_game.xml
View file @
6abe1256
...
...
@@ -45,12 +45,6 @@
android:key=
"pref_settings_read_ex"
android:persistent=
"true"
android:title=
"@string/title_use_ex"
/>
<!-- 启用游戏音效
<CheckBoxPreference
android:key="pref_key_game_sound_effect"
android:persistent="true"
android:title="@string/settings_game_enable_sound_effect" />
-->
<CheckBoxPreference
android:key=
"pref_key_game_screen_orientation"
android:persistent=
"true"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment