Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile
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
Commits
ae187ac6
Commit
ae187ac6
authored
Aug 07, 2021
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化清除
parent
6715374a
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
54 additions
and
25 deletions
+54
-25
irrlicht/source/Irrlicht/Android/CIrrDeviceAndroid.cpp
irrlicht/source/Irrlicht/Android/CIrrDeviceAndroid.cpp
+3
-1
irrlicht/source/Irrlicht/Android/CIrrDeviceAndroid.h
irrlicht/source/Irrlicht/Android/CIrrDeviceAndroid.h
+13
-0
libcore/android/android_tools.h
libcore/android/android_tools.h
+1
-0
libcore/jni/cn_garymb_ygomobile_core_IrrlichtBridge.cpp
libcore/jni/cn_garymb_ygomobile_core_IrrlichtBridge.cpp
+1
-1
libcore/src/main/AndroidManifest.xml
libcore/src/main/AndroidManifest.xml
+0
-2
libcore/src/main/java/cn/garymb/ygomobile/YGOMobileActivity.java
.../src/main/java/cn/garymb/ygomobile/YGOMobileActivity.java
+24
-13
mobile/src/main/AndroidManifest.xml
mobile/src/main/AndroidManifest.xml
+12
-8
No files found.
irrlicht/source/Irrlicht/Android/CIrrDeviceAndroid.cpp
View file @
ae187ac6
...
@@ -200,7 +200,9 @@ E_DEVICE_TYPE CIrrDeviceAndroid::getType() const
...
@@ -200,7 +200,9 @@ E_DEVICE_TYPE CIrrDeviceAndroid::getType() const
void
CIrrDeviceAndroid
::
handleAndroidCommand
(
ANDROID_APP
app
,
int32_t
cmd
)
void
CIrrDeviceAndroid
::
handleAndroidCommand
(
ANDROID_APP
app
,
int32_t
cmd
)
{
{
CIrrDeviceAndroid
*
device
=
(
CIrrDeviceAndroid
*
)
app
->
userData
;
CIrrDeviceAndroid
*
device
=
(
CIrrDeviceAndroid
*
)
app
->
userData
;
if
(
device
->
onAppCmd
!=
nullptr
){
device
->
onAppCmd
(
app
,
cmd
);
}
switch
(
cmd
)
switch
(
cmd
)
{
{
case
APP_CMD_SAVE_STATE
:
case
APP_CMD_SAVE_STATE
:
...
...
irrlicht/source/Irrlicht/Android/CIrrDeviceAndroid.h
View file @
ae187ac6
...
@@ -58,6 +58,19 @@ namespace irr
...
@@ -58,6 +58,19 @@ namespace irr
core
::
array
<
EKEY_CODE
>
KeyMap
;
core
::
array
<
EKEY_CODE
>
KeyMap
;
bool
isPaused
(){
return
Paused
;
}
bool
isFocused
(){
return
Focused
;
}
bool
isDestroy
(){
return
!
Initialized
;
}
void
(
*
onAppCmd
)(
struct
android_app
*
app
,
int32_t
cmd
)
=
nullptr
;
private:
private:
static
void
handleAndroidCommand
(
ANDROID_APP
app
,
int32_t
cmd
);
static
void
handleAndroidCommand
(
ANDROID_APP
app
,
int32_t
cmd
);
...
...
libcore/android/android_tools.h
View file @
ae187ac6
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
#include <android_native_app_glue.h>
#include <android_native_app_glue.h>
#include <signal.h>
#include <signal.h>
#include <android/log.h>
#include <android/log.h>
#include <Android/CIrrDeviceAndroid.h>
#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "ygomobile-native", __VA_ARGS__))
#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "ygomobile-native", __VA_ARGS__))
#define LOGW(...) ((void)__android_log_print(ANDROID_LOG_WARN, "ygomobile-native", __VA_ARGS__))
#define LOGW(...) ((void)__android_log_print(ANDROID_LOG_WARN, "ygomobile-native", __VA_ARGS__))
...
...
libcore/jni/cn_garymb_ygomobile_core_IrrlichtBridge.cpp
View file @
ae187ac6
...
@@ -297,7 +297,7 @@ static void* join_game_thread(void* param) {
...
@@ -297,7 +297,7 @@ static void* join_game_thread(void* param) {
JNIEXPORT
void
JNICALL
Java_cn_garymb_ygomobile_core_IrrlichtBridge_nativeSetInputFix
(
JNIEXPORT
void
JNICALL
Java_cn_garymb_ygomobile_core_IrrlichtBridge_nativeSetInputFix
(
JNIEnv
*
env
,
jclass
clazz
,
jlong
handle
,
jint
x
,
jint
y
)
{
JNIEnv
*
env
,
jclass
clazz
,
jlong
handle
,
jint
x
,
jint
y
)
{
if
(
ygo
::
mainGame
)
{
if
(
ygo
::
mainGame
)
{
__android_log_print
(
ANDROID_LOG_INFO
,
"ygo"
,
"setInputFix posX=%d, posY=%d"
,
x
,
y
);
ALOGD
(
"setInputFix posX=%d, posY=%d"
,
x
,
y
);
ygo
::
mainGame
->
setPositionFix
(
core
::
position2di
(
x
,
y
));
ygo
::
mainGame
->
setPositionFix
(
core
::
position2di
(
x
,
y
));
}
}
}
}
...
...
libcore/src/main/AndroidManifest.xml
View file @
ae187ac6
...
@@ -9,9 +9,7 @@
...
@@ -9,9 +9,7 @@
<application>
<application>
<activity
<activity
android:name=
"cn.garymb.ygomobile.YGOMobileActivity"
android:name=
"cn.garymb.ygomobile.YGOMobileActivity"
android:clearTaskOnLaunch=
"true"
android:configChanges=
"orientation|keyboardHidden|screenSize"
android:configChanges=
"orientation|keyboardHidden|screenSize"
android:excludeFromRecents=
"true"
android:exported=
"true"
android:exported=
"true"
android:label=
"YGOMobile"
android:label=
"YGOMobile"
android:process=
":game"
android:process=
":game"
...
...
libcore/src/main/java/cn/garymb/ygomobile/YGOMobileActivity.java
View file @
ae187ac6
...
@@ -60,9 +60,6 @@ public class YGOMobileActivity extends NativeActivity implements
...
@@ -60,9 +60,6 @@ public class YGOMobileActivity extends NativeActivity implements
private
static
final
int
CHAIN_CONTROL_PANEL_X_POSITION_LEFT_EDGE
=
205
;
private
static
final
int
CHAIN_CONTROL_PANEL_X_POSITION_LEFT_EDGE
=
205
;
private
static
final
int
CHAIN_CONTROL_PANEL_Y_REVERT_POSITION
=
100
;
private
static
final
int
CHAIN_CONTROL_PANEL_Y_REVERT_POSITION
=
100
;
private
static
final
int
MAX_REFRESH
=
30
*
1000
;
private
static
final
int
MAX_REFRESH
=
30
*
1000
;
private
static
int
sChainControlXPostion
=
-
1
;
private
static
int
sChainControlYPostion
=
-
1
;
private
static
boolean
USE_SURFACE
=
true
;
protected
final
int
windowsFlags
=
protected
final
int
windowsFlags
=
Build
.
VERSION
.
SDK_INT
>=
19
?
(
Build
.
VERSION
.
SDK_INT
>=
19
?
(
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
...
@@ -80,6 +77,8 @@ public class YGOMobileActivity extends NativeActivity implements
...
@@ -80,6 +77,8 @@ public class YGOMobileActivity extends NativeActivity implements
private
NetworkController
mNetController
;
private
NetworkController
mNetController
;
private
volatile
boolean
mOverlayShowRequest
=
false
;
private
volatile
boolean
mOverlayShowRequest
=
false
;
private
volatile
int
mCompatGUIMode
;
private
volatile
int
mCompatGUIMode
;
private
static
int
sChainControlXPostion
=
-
1
;
private
static
int
sChainControlYPostion
=
-
1
;
private
GameApplication
mApp
;
private
GameApplication
mApp
;
private
Handler
handler
=
new
Handler
();
private
Handler
handler
=
new
Handler
();
private
FullScreenUtils
mFullScreenUtils
;
private
FullScreenUtils
mFullScreenUtils
;
...
@@ -87,12 +86,11 @@ public class YGOMobileActivity extends NativeActivity implements
...
@@ -87,12 +86,11 @@ public class YGOMobileActivity extends NativeActivity implements
private
FrameLayout
mLayout
;
private
FrameLayout
mLayout
;
private
SurfaceView
mSurfaceView
;
private
SurfaceView
mSurfaceView
;
private
boolean
replaced
=
false
;
private
boolean
replaced
=
false
;
private
static
boolean
USE_SURFACE
=
true
;
private
String
[]
mArgV
;
private
String
[]
mArgV
;
private
boolean
onGameExiting
;
// public static int notchHeight;
// public static int notchHeight;
//电池管理
private
PowerManager
mPM
;
private
PowerManager
.
WakeLock
mLock
;
private
GameApplication
app
()
{
private
GameApplication
app
()
{
if
(
mApp
==
null
)
{
if
(
mApp
==
null
)
{
...
@@ -138,6 +136,10 @@ public class YGOMobileActivity extends NativeActivity implements
...
@@ -138,6 +136,10 @@ public class YGOMobileActivity extends NativeActivity implements
.
setPackage
(
getPackageName
()));
.
setPackage
(
getPackageName
()));
}
}
//电池管理
private
PowerManager
mPM
;
private
PowerManager
.
WakeLock
mLock
;
@Override
@Override
protected
void
onResume
()
{
protected
void
onResume
()
{
super
.
onResume
();
super
.
onResume
();
...
@@ -547,17 +549,26 @@ public class YGOMobileActivity extends NativeActivity implements
...
@@ -547,17 +549,26 @@ public class YGOMobileActivity extends NativeActivity implements
@Override
@Override
public
void
onGameExit
()
{
public
void
onGameExit
()
{
if
(
onGameExiting
){
return
;
}
onGameExiting
=
true
;
Log
.
e
(
"ygomobile"
,
"game exit"
);
Log
.
e
(
"ygomobile"
,
"game exit"
);
Intent
intent
=
new
Intent
(
"ygomobile.intent.action.GAME"
);
final
Intent
intent
=
new
Intent
(
"ygomobile.intent.action.GAME"
);
intent
.
addCategory
(
Intent
.
CATEGORY_DEFAULT
);
intent
.
addCategory
(
Intent
.
CATEGORY_DEFAULT
);
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
);
intent
.
addFlags
(
Intent
.
FLAG_ACTIVITY_RESET_TASK_IF_NEEDED
);
intent
.
putExtra
(
"game_exit_time"
,
System
.
currentTimeMillis
());
intent
.
setPackage
(
getPackageName
());
intent
.
setPackage
(
getPackageName
());
try
{
runOnUiThread
(
new
Runnable
()
{
startActivity
(
intent
);
@Override
}
catch
(
Throwable
ignore
)
{
public
void
run
()
{
try
{
}
startActivity
(
intent
);
Process
.
killProcess
(
Process
.
myPid
());
}
catch
(
Throwable
ignore
)
{}
finishAndRemoveTask
();
Process
.
killProcess
(
Process
.
myPid
());
}
});
}
}
}
}
mobile/src/main/AndroidManifest.xml
View file @
ae187ac6
...
@@ -15,12 +15,12 @@
...
@@ -15,12 +15,12 @@
android:usesCleartextTraffic=
"true"
android:usesCleartextTraffic=
"true"
android:extractNativeLibs=
"true"
android:extractNativeLibs=
"true"
android:requestLegacyExternalStorage=
"true"
android:requestLegacyExternalStorage=
"true"
android:taskAffinity=
"cn.garymb.ygomobile.task"
tools:replace=
"android:allowBackup,android:supportsRtl"
tools:replace=
"android:allowBackup,android:supportsRtl"
tools:targetApi=
"m"
>
tools:targetApi=
"m"
>
<activity
<activity
android:name=
"cn.garymb.ygomobile.ui.activities.LogoActivity"
android:name=
"cn.garymb.ygomobile.ui.activities.LogoActivity"
android:excludeFromRecents=
"false"
android:excludeFromRecents=
"false"
android:taskAffinity=
"cn.garymb.logo"
android:theme=
"@style/TranslucentTheme"
>
android:theme=
"@style/TranslucentTheme"
>
<intent-filter>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<action
android:name=
"android.intent.action.MAIN"
/>
...
@@ -33,14 +33,18 @@
...
@@ -33,14 +33,18 @@
</activity>
</activity>
<activity
android:name=
"com.tencent.bugly.beta.ui.BetaActivity"
android:launchMode=
"singleTop"
android:configChanges=
"keyboardHidden|orientation|screenSize|locale"
android:excludeFromRecents=
"true"
/>
<activity
<activity
android:name=
"cn.garymb.ygomobile.ui.home.MainActivity"
android:name=
"cn.garymb.ygomobile.ui.home.MainActivity"
android:configChanges=
"orientation|keyboardHidden|navigation|screenSize"
android:configChanges=
"orientation|keyboardHidden|navigation|screenSize"
android:excludeFromRecents=
"false"
android:exported=
"true"
android:exported=
"true"
android:screenOrientation=
"portrait"
android:screenOrientation=
"portrait"
android:launchMode=
"singleTop"
android:launchMode=
"singleTop"
android:stateNotNeeded=
"true"
android:theme=
"@style/AppTheme"
android:theme=
"@style/AppTheme"
android:windowSoftInputMode=
"stateAlwaysHidden|adjustResize"
>
android:windowSoftInputMode=
"stateAlwaysHidden|adjustResize"
>
<intent-filter>
<intent-filter>
...
@@ -119,6 +123,11 @@
...
@@ -119,6 +123,11 @@
android:name=
"cn.garymb.ygomobile.YGOMobileActivity"
android:name=
"cn.garymb.ygomobile.YGOMobileActivity"
android:theme=
"@style/AppTheme.Game"
android:theme=
"@style/AppTheme.Game"
tools:replace=
"android:theme"
/>
tools:replace=
"android:theme"
/>
<receiver
android:name=
"cn.garymb.ygomobile.GameReceiver"
android:enabled=
"false"
/>
<activity
<activity
android:name=
"cn.garymb.ygomobile.ui.preference.SettingsActivity"
android:name=
"cn.garymb.ygomobile.ui.preference.SettingsActivity"
android:configChanges=
"orientation|keyboardHidden|navigation|screenSize"
android:configChanges=
"orientation|keyboardHidden|navigation|screenSize"
...
@@ -187,11 +196,6 @@
...
@@ -187,11 +196,6 @@
<activity
<activity
android:name=
"cn.garymb.ygomobile.ui.activities.PermissionsActivity"
android:name=
"cn.garymb.ygomobile.ui.activities.PermissionsActivity"
android:theme=
"@style/TranslucentTheme"
/>
android:theme=
"@style/TranslucentTheme"
/>
<activity
android:name=
"com.tencent.bugly.beta.ui.BetaActivity"
android:configChanges=
"keyboardHidden|orientation|screenSize|locale"
android:theme=
"@android:style/Theme.Translucent"
/>
<meta-data
<meta-data
android:name=
"BUGLY_APPID"
android:name=
"BUGLY_APPID"
android:value=
"${APP_ID}"
/>
android:value=
"${APP_ID}"
/>
...
...
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