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
24390b82
Commit
24390b82
authored
May 26, 2021
by
kenan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
适配arm64,根据abi分包
parent
cd618ca4
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
69 additions
and
36 deletions
+69
-36
Classes/libevent/epoll_sub.c
Classes/libevent/epoll_sub.c
+13
-3
gradle.properties
gradle.properties
+1
-0
libcore/android/TouchEventTransferAndroid.cpp
libcore/android/TouchEventTransferAndroid.cpp
+1
-1
libcore/android/android_tools.cpp
libcore/android/android_tools.cpp
+2
-2
libcore/jni/Application.mk
libcore/jni/Application.mk
+2
-2
libcore/jni/cn_garymb_ygomobile_core_IrrlichtBridge.cpp
libcore/jni/cn_garymb_ygomobile_core_IrrlichtBridge.cpp
+9
-9
libcore/src/main/java/cn/garymb/ygomobile/YGOMobileActivity.java
.../src/main/java/cn/garymb/ygomobile/YGOMobileActivity.java
+1
-1
libcore/src/main/java/cn/garymb/ygomobile/core/IrrlichtBridge.java
...rc/main/java/cn/garymb/ygomobile/core/IrrlichtBridge.java
+11
-11
mobile/build.gradle
mobile/build.gradle
+29
-7
No files found.
Classes/libevent/epoll_sub.c
View file @
24390b82
...
...
@@ -32,21 +32,31 @@
#include <sys/epoll.h>
#include <unistd.h>
//http://androidxref.com/9.0.0_r3/xref/bionic/libc/bionic/sys_epoll.cpp
int
epoll_create
(
int
size
)
{
return
(
syscall
(
__NR_epoll_create
,
size
));
#ifdef __LP64__
return
(
int
)(
syscall
(
__NR_epoll_create1
,
size
));
#else
return
(
int
)(
syscall
(
__NR_epoll_create
,
size
));
#endif
}
int
epoll_ctl
(
int
epfd
,
int
op
,
int
fd
,
struct
epoll_event
*
event
)
{
return
(
syscall
(
__NR_epoll_ctl
,
epfd
,
op
,
fd
,
event
));
return
(
int
)(
syscall
(
__NR_epoll_ctl
,
epfd
,
op
,
fd
,
event
));
}
int
epoll_wait
(
int
epfd
,
struct
epoll_event
*
events
,
int
maxevents
,
int
timeout
)
{
return
(
syscall
(
__NR_epoll_wait
,
epfd
,
events
,
maxevents
,
timeout
));
#ifdef __LP64__
return
(
int
)(
syscall
(
__NR_epoll_pwait
,
epfd
,
events
,
maxevents
,
timeout
,
NULL
,
0
));
#else
return
(
int
)(
syscall
(
__NR_epoll_wait
,
epfd
,
events
,
maxevents
,
timeout
));
#endif
}
gradle.properties
View file @
24390b82
...
...
@@ -14,3 +14,4 @@
android.enableJetifier
=
true
android.useAndroidX
=
true
org.gradle.jvmargs
=
-Xmx2048M -Dkotlin.daemon.jvm.options
\=
"-Xmx2048M"
android.injected.testOnly
=
false
\ No newline at end of file
libcore/android/TouchEventTransferAndroid.cpp
View file @
24390b82
...
...
@@ -188,7 +188,7 @@ void TouchEventTransferAndroid::set_long_click_handler(int mode) {
}
void
TouchEventTransferAndroid
::
long_press_handler
(
sigval_t
info
)
{
int
mode
=
(
int
)
info
.
sival_ptr
;
int
mode
=
(
int
)
(
long
)
info
.
sival_ptr
;
char
log
[
256
];
sprintf
(
log
,
"receve long click %d"
,
mode
);
os
::
Printer
::
log
(
log
);
...
...
libcore/android/android_tools.cpp
View file @
24390b82
...
...
@@ -749,8 +749,8 @@ core::position2di initJavaBridge(ANDROID_APP app, void* handle) {
jobject
lNativeActivity
=
app
->
activity
->
clazz
;
jclass
ClassNativeActivity
=
jni
->
GetObjectClass
(
lNativeActivity
);
jmethodID
MethodSetHandle
=
jni
->
GetMethodID
(
ClassNativeActivity
,
"setNativeHandle"
,
"(
I
)V"
);
j
int
code
=
(
int
)
handle
;
"setNativeHandle"
,
"(
J
)V"
);
j
long
code
=
(
jlong
)
handle
;
jni
->
CallVoidMethod
(
lNativeActivity
,
MethodSetHandle
,
code
);
...
...
libcore/jni/Application.mk
View file @
24390b82
APP_ABI
:=
armeabi-v7a x86
#APP_ABI := arm64-v8a
APP_ABI
:=
armeabi-v7a x86
arm64-v8a
APP_PLATFORM
:=
android-21
#APP_MODULES := YGOMobile
#NDK_TOOLCHAIN_VERSION=4.8
...
...
libcore/jni/cn_garymb_ygomobile_core_IrrlichtBridge.cpp
View file @
24390b82
...
...
@@ -24,7 +24,7 @@ const static char secret_key[] = "O2zMfI3gqJYYJSAuCeUkH9J_vm5S_A4Yn8fhrjU3";
* Method: nativeInsertText
* Signature: (ILjava/lang/String;)V
*/
JNIEXPORT
void
JNICALL
Java_cn_garymb_ygomobile_core_IrrlichtBridge_nativeInsertText
(
JNIEnv
*
env
,
jclass
clazz
,
j
int
handle
,
jstring
textString
)
{
JNIEnv
*
env
,
jclass
clazz
,
j
long
handle
,
jstring
textString
)
{
if
(
handle
)
{
IrrlichtDevice
*
device
=
(
IrrlichtDevice
*
)
handle
;
IGUIEnvironment
*
irrenv
=
device
->
getGUIEnvironment
();
...
...
@@ -112,7 +112,7 @@ JNIEXPORT jbyteArray JNICALL Java_cn_garymb_ygomobile_core_IrrlichtBridge_native
* Method: nativeSetComboBoxSelection
* Signature: (II)V
*/
JNIEXPORT
void
JNICALL
Java_cn_garymb_ygomobile_core_IrrlichtBridge_nativeSetComboBoxSelection
(
JNIEnv
*
env
,
jclass
clazz
,
j
int
handle
,
jint
idx
)
{
JNIEnv
*
env
,
jclass
clazz
,
j
long
handle
,
jint
idx
)
{
if
(
handle
)
{
IrrlichtDevice
*
device
=
(
IrrlichtDevice
*
)
handle
;
IGUIEnvironment
*
irrenv
=
device
->
getGUIEnvironment
();
...
...
@@ -147,7 +147,7 @@ JNIEXPORT jbyteArray JNICALL Java_cn_garymb_ygomobile_core_IrrlichtBridge_native
* Method: nativeSetCheckBoxesSelection
* Signature: (II)V
*/
JNIEXPORT
void
JNICALL
Java_cn_garymb_ygomobile_core_IrrlichtBridge_nativeSetCheckBoxesSelection
(
JNIEnv
*
env
,
jclass
clazz
,
j
int
handle
,
jint
idx
)
{
JNIEnv
*
env
,
jclass
clazz
,
j
long
handle
,
jint
idx
)
{
if
(
handle
)
{
IrrlichtDevice
*
device
=
(
IrrlichtDevice
*
)
handle
;
IGUIEnvironment
*
irrenv
=
device
->
getGUIEnvironment
();
...
...
@@ -232,7 +232,7 @@ static void* join_game_thread(void* param) {
* Method: nativeRefreshTexture
* Signature: (I)V
*/
JNIEXPORT
void
JNICALL
Java_cn_garymb_ygomobile_core_IrrlichtBridge_nativeRefreshTexture
(
JNIEnv
*
env
,
jclass
clazz
,
j
int
handle
)
{
JNIEnv
*
env
,
jclass
clazz
,
j
long
handle
)
{
if
(
handle
)
{
IrrlichtDevice
*
device
=
(
IrrlichtDevice
*
)
handle
;
...
...
@@ -255,7 +255,7 @@ static void* join_game_thread(void* param) {
* Method: nativeIgnoreChain
* Signature: (IZ)V
*/
JNIEXPORT
void
JNICALL
Java_cn_garymb_ygomobile_core_IrrlichtBridge_nativeIgnoreChain
(
JNIEnv
*
env
,
jclass
clazz
,
j
int
handle
,
jboolean
begin
)
{
JNIEnv
*
env
,
jclass
clazz
,
j
long
handle
,
jboolean
begin
)
{
if
(
handle
)
{
IrrlichtDevice
*
device
=
(
IrrlichtDevice
*
)
handle
;
if
(
device
->
isWindowFocused
())
{
...
...
@@ -277,7 +277,7 @@ static void* join_game_thread(void* param) {
* Method: nativeReactChain
* Signature: (IZ)V
*/
JNIEXPORT
void
JNICALL
Java_cn_garymb_ygomobile_core_IrrlichtBridge_nativeReactChain
(
JNIEnv
*
env
,
jclass
clazz
,
j
int
handle
,
jboolean
begin
)
{
JNIEnv
*
env
,
jclass
clazz
,
j
long
handle
,
jboolean
begin
)
{
if
(
handle
)
{
IrrlichtDevice
*
device
=
(
IrrlichtDevice
*
)
handle
;
if
(
device
->
isWindowFocused
())
{
...
...
@@ -295,7 +295,7 @@ static void* join_game_thread(void* param) {
}
JNIEXPORT
void
JNICALL
Java_cn_garymb_ygomobile_core_IrrlichtBridge_nativeSetInputFix
(
JNIEnv
*
env
,
jclass
clazz
,
j
int
handle
,
jint
x
,
jint
y
)
{
JNIEnv
*
env
,
jclass
clazz
,
j
long
handle
,
jint
x
,
jint
y
)
{
if
(
ygo
::
mainGame
)
{
__android_log_print
(
ANDROID_LOG_INFO
,
"ygo"
,
"setInputFix posX=%d, posY=%d"
,
x
,
y
);
ygo
::
mainGame
->
setPositionFix
(
core
::
position2di
(
x
,
y
));
...
...
@@ -324,7 +324,7 @@ static void* cancel_chain_thread(void* param) {
* Method: nativeCancelChain
* Signature: (I)V
*/
JNIEXPORT
void
JNICALL
Java_cn_garymb_ygomobile_core_IrrlichtBridge_nativeCancelChain
(
JNIEnv
*
env
,
jclass
clazz
,
j
int
handle
)
{
JNIEnv
*
env
,
jclass
clazz
,
j
long
handle
)
{
if
(
handle
)
{
IrrlichtDevice
*
device
=
(
IrrlichtDevice
*
)
handle
;
if
(
device
->
isWindowFocused
())
{
...
...
@@ -344,7 +344,7 @@ static void* cancel_chain_thread(void* param) {
* Method: nativeJoinGame
* Signature: (ILjava/nio/ByteBuffer;I)V
*/
JNIEXPORT
void
JNICALL
Java_cn_garymb_ygomobile_core_IrrlichtBridge_nativeJoinGame
(
JNIEnv
*
env
,
jclass
clazz
,
j
int
handle
,
jobject
buffer
,
jint
length
)
{
JNIEnv
*
env
,
jclass
clazz
,
j
long
handle
,
jobject
buffer
,
jint
length
)
{
void
*
data
=
env
->
GetDirectBufferAddress
(
buffer
);
s_init_param_buffer
=
malloc
(
length
);
memcpy
(
s_init_param_buffer
,
data
,
length
);
...
...
libcore/src/main/java/cn/garymb/ygomobile/YGOMobileActivity.java
View file @
24390b82
...
...
@@ -470,7 +470,7 @@ public class YGOMobileActivity extends NativeActivity implements
}
@Override
public
void
setNativeHandle
(
int
nativeHandle
)
{
public
void
setNativeHandle
(
long
nativeHandle
)
{
IrrlichtBridge
.
sNativeHandle
=
nativeHandle
;
}
...
...
libcore/src/main/java/cn/garymb/ygomobile/core/IrrlichtBridge.java
View file @
24390b82
...
...
@@ -39,27 +39,27 @@ public final class IrrlichtBridge {
}
public
static
int
sNativeHandle
;
public
static
long
sNativeHandle
;
//显示卡图
public
static
native
byte
[]
nativeBpgImage
(
byte
[]
data
);
//插入文本(大概是发送消息)
private
static
native
void
nativeInsertText
(
int
handle
,
String
text
);
private
static
native
void
nativeInsertText
(
long
handle
,
String
text
);
//刷新文字
private
static
native
void
nativeRefreshTexture
(
int
handle
);
private
static
native
void
nativeRefreshTexture
(
long
handle
);
//忽略时点
private
static
native
void
nativeIgnoreChain
(
int
handle
,
boolean
begin
);
private
static
native
void
nativeIgnoreChain
(
long
handle
,
boolean
begin
);
//强制时点
private
static
native
void
nativeReactChain
(
int
handle
,
boolean
begin
);
private
static
native
void
nativeReactChain
(
long
handle
,
boolean
begin
);
//取消连锁
private
static
native
void
nativeCancelChain
(
int
handle
);
private
static
native
void
nativeCancelChain
(
long
handle
);
private
static
native
void
nativeSetCheckBoxesSelection
(
int
handle
,
int
idx
);
private
static
native
void
nativeSetCheckBoxesSelection
(
long
handle
,
int
idx
);
private
static
native
void
nativeSetComboBoxSelection
(
int
handle
,
int
idx
);
private
static
native
void
nativeSetComboBoxSelection
(
long
handle
,
int
idx
);
private
static
native
void
nativeJoinGame
(
int
handle
,
ByteBuffer
buffer
,
int
length
);
private
static
native
void
nativeJoinGame
(
long
handle
,
ByteBuffer
buffer
,
int
length
);
private
static
native
void
nativeSetInputFix
(
int
handle
,
int
x
,
int
y
);
private
static
native
void
nativeSetInputFix
(
long
handle
,
int
x
,
int
y
);
private
static
final
boolean
DEBUG
=
false
;
private
static
final
String
TAG
=
IrrlichtBridge
.
class
.
getSimpleName
();
...
...
@@ -205,7 +205,7 @@ public final class IrrlichtBridge {
int
getLocalAddress
();
void
setNativeHandle
(
int
nativeHandle
);
void
setNativeHandle
(
long
nativeHandle
);
int
getPositionX
();
...
...
mobile/build.gradle
View file @
24390b82
...
...
@@ -18,27 +18,49 @@ android {
sourceCompatibility
JavaVersion
.
VERSION_1_8
targetCompatibility
JavaVersion
.
VERSION_1_8
}
flavorDimensions
'abi'
,
'lang'
productFlavors
{
cn
{
dimension
'lang'
manifestPlaceholders
=
[
APP_ID:
"0b6f110306"
]
}
en
{
dimension
'lang'
applicationIdSuffix
".EN"
manifestPlaceholders
=
[
APP_ID:
"9c66525dfa"
]
}
ko
{
dimension
'lang'
applicationIdSuffix
".KO"
manifestPlaceholders
=
[
APP_ID:
"0488398d8a"
]
}
x86
{
dimension
'abi'
ndk
{
abiFilters
"x86"
}
splits
{
abi
{
enable
true
reset
()
include
'x86'
,
'armeabi-v7a'
,
'arm64-v8a'
universalApk
true
}
arm
{
dimension
'abi'
ndk
{
abiFilters
"armeabi-v7a"
}
}
arm64
{
dimension
'abi'
ndk
{
abiFilters
"arm64-v8a"
}
}
}
// splits {
// abi {
// enable true
// reset()
// include 'x86', 'armeabi-v7a', 'arm64-v8a'
// universalApk true
// }
// }
buildTypes
{
release
{
shrinkResources
false
...
...
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