Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro2
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
mercury233
ygopro2
Commits
95570520
Commit
95570520
authored
May 05, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some patches for generated libs
parent
3ee6435f
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
489 additions
and
13 deletions
+489
-13
.gitignore
.gitignore
+3
-0
.gitlab-ci.bat
.gitlab-ci.bat
+4
-9
.gitlab-ci.yml
.gitlab-ci.yml
+44
-4
misc/URLUtility.mm
misc/URLUtility.mm
+35
-0
misc/original-patches/Preprocessor.h .diff.txt
misc/original-patches/Preprocessor.h .diff.txt
+11
-0
misc/original-patches/iPhone_Sensors.mm.diff.txt
misc/original-patches/iPhone_Sensors.mm.diff.txt
+175
-0
misc/patches/Preprocessor.h.patch
misc/patches/Preprocessor.h.patch
+11
-0
misc/patches/iPhone_Sensors.mm.patch
misc/patches/iPhone_Sensors.mm.patch
+182
-0
patches.sh
patches.sh
+24
-0
No files found.
.gitignore
View file @
95570520
...
...
@@ -67,3 +67,6 @@ Assets/StreamingAssets/update.zip*
commamd.shell
/output
/Classes
/Libraries
/URLUtility.o
.gitlab-ci.bat
View file @
95570520
...
...
@@ -3,13 +3,8 @@
set
UNITY_PATH
=
"C:\Program Files\Unity\Editor\Unity.exe"
mkdir
output
mkdir
KoishiPro2
-src
%UNITY_PATH%
-batchmode -nographics -silent-crashes -projectPath
%cd%
-logFile
KoishiPro2
-src
/build
.log
-executeMethod
BuildHelper
.Build
-quit
mkdir
dist
%UNITY_PATH%
-batchmode -nographics -silent-crashes -projectPath
%cd%
-logFile
dist
/build
.log
-executeMethod
BuildHelper
.Build
-quit
if
%errorlevel%
neq
0
exit
/b
%errorlevel%
cat
KoishiPro2
-src/build
.log
bash
-c
"sed -i '/>UIStatusBarStyle</i\ <key>UIFileSharingEnabled</key>\n <true />\n <key>LSSupportsOpeningDocumentsInPlace</key>\n <true />' output/Info.plist"
cd
output
7
z
a
-mx
9
../KoishiPro2
-src/KoishiPro
2
-src
.7z
*
cd
..
cat
dist
/build
.log
mv
output
dist
/src
.gitlab-ci.yml
View file @
95570520
stages
:
-
build
-
patch
-
deploy
variables
:
...
...
@@ -15,22 +16,61 @@ unity:
script
:
cmd /C .gitlab-ci.bat
artifacts
:
paths
:
-
KoishiPro2-src
/
-
dist
/
only
:
-
Android
-
tags
tags
:
-
unity
upload_to_minio
:
stage
:
deploy
patch
:
stage
:
patch
dependencies
:
-
unity
script
:
-
apt update; apt -y install tar
-
mv dist/src ./unity-src
-
cd unity-src
-
cp -rf ../patches.sh .
-
cp -rf ../misc .
-
chmod +x *.sh
-
sed -i '/>UIStatusBarStyle</i\ <key>UIFileSharingEnabled</key>\n <true />\n <key>LSSupportsOpeningDocumentsInPlace</key>\n <true />' output/Info.plist
-
patch -p1 < ../misc/patches/iPhone_Sensors.mm.patch
-
echo '#define UNITY_USES_LOCATION 0' >> ./Classes/Preprocessor.h
-
tar zcvf ../dist/KoishiPro2-src.tar.gz * .*
-
cd ..
artifacts
:
paths
:
-
dist/
only
:
-
Android
-
tags
tags
:
-
linux
upload_to_minio_latest
:
stage
:
deploy
dependencies
:
-
patch
tags
:
-
linux
image
:
python
script
:
-
pip install -U awscli
-
aws s3 --endpoint=https://minio.mycard.moe:9000 sync --delete dist/ s3://mycard/koishipro2/latest
only
:
-
Android
-
tags
upload_to_minio_tag
:
stage
:
deploy
dependencies
:
-
patch
tags
:
-
linux
image
:
python
script
:
-
pip install -U awscli
-
aws s3 --endpoint=https://minio.mycard.moe:9000 sync --delete
KoishiPro2-src
/ s3://mycard/koishipro2/$CI_COMMIT_TAG
-
aws s3 --endpoint=https://minio.mycard.moe:9000 sync --delete
dist
/ s3://mycard/koishipro2/$CI_COMMIT_TAG
only
:
-
tags
misc/URLUtility.mm
0 → 100644
View file @
95570520
#include <iostream>
#import <UIKit/UIKit.h>
using
namespace
std
;
namespace
core
{
template
<
class
type
>
class
StringStorageDefault
{};
template
<
class
type
,
class
type2
>
class
basic_string
{
public:
char
*
str
;
basic_string
(
char
*
arg
){
str
=
arg
;
}
};
}
void
OpenURLInGame
(
core
::
basic_string
<
char
,
core
::
StringStorageDefault
<
char
>
>
const
&
arg
){}
void
OpenURL
(
core
::
basic_string
<
char
,
core
::
StringStorageDefault
<
char
>
>
const
&
arg
){
const
void
*
arg2
=
arg
.
str
;
UIApplication
*
app
=
[
UIApplication
sharedApplication
];
NSString
*
urlStr
=
[
NSString
stringWithUTF8String
:(
char
*
)
arg2
];
NSURL
*
url
=
[
NSURL
URLWithString
:
urlStr
];
[
app
openURL
:
url
];
}
void
OpenURL
(
std
::
string
const
&
arg
){
UIApplication
*
app
=
[
UIApplication
sharedApplication
];
NSString
*
urlStr
=
[
NSString
stringWithUTF8String
:
arg
.
c_str
()];
NSURL
*
url
=
[
NSURL
URLWithString
:
urlStr
];
[
app
openURL
:
url
];
}
misc/original-patches/Preprocessor.h .diff.txt
0 → 100644
View file @
95570520
diff --git a/Classes/Preprocessor.h b/Classes/Preprocessor.h
--- a/Classes/Preprocessor.h
+++ b/Classes/Preprocessor.h
@@ -121,6 +121,7 @@
#define UNITY_USES_REPLAY_KIT 0
#define UNITY_SNAPSHOT_VIEW_ON_APPLICATION_PAUSE 0
#define UNITY_DEVELOPER_BUILD 0
+#define UNITY_USES_LOCATION 0
#define USE_IL2CPP_PCH 0
#define UNITY_SUPPORT_ROTATION PLATFORM_IOS
misc/original-patches/iPhone_Sensors.mm.diff.txt
0 → 100644
View file @
95570520
diff --git a/Classes/iPhone_Sensors.mm b/Classes/iPhone_Sensors.mm
--- a/Classes/iPhone_Sensors.mm
+++ b/Classes/iPhone_Sensors.mm
@@ -1,7 +1,11 @@
#define SIMULATE_ATTITUDE_FROM_GRAVITY 1
#import "iPhone_Sensors.h"
+
+#if UNITY_USES_LOCATION
#import <CoreLocation/CoreLocation.h>
+#endif
+
#if !PLATFORM_TVOS
#import <CoreMotion/CoreMotion.h>
#endif
@@ -767,9 +771,10 @@ extern "C" void UnityGetNiceKeyname(int
#pragma clang diagnostic pop
-
+#if UNITY_USES_LOCATION
@interface LocationServiceDelegate : NSObject<CLLocationManagerDelegate>
@end
+#endif
void
UnitySetLastLocation(double timestamp,
@@ -785,6 +790,7 @@ UnitySetLastHeading(float magneticHeadin
float rawX, float rawY, float rawZ,
double timestamp);
+#if UNITY_USES_LOCATION
struct LocationServiceInfo
{
private:
@@ -825,40 +831,56 @@ CLLocationManager* LocationServiceInfo::
return locationManager;
}
+#endif
+
bool LocationService::IsServiceEnabledByUser()
{
+#if UNITY_USES_LOCATION
return [CLLocationManager locationServicesEnabled];
+#else
+ return false;
+#endif
}
void LocationService::SetDesiredAccuracy(float val)
{
+#if UNITY_USES_LOCATION
gLocationServiceStatus.desiredAccuracy = val;
+#endif
}
float LocationService::GetDesiredAccuracy()
{
+#if UNITY_USES_LOCATION
return gLocationServiceStatus.desiredAccuracy;
+#else
+ return NAN;
+#endif
}
void LocationService::SetDistanceFilter(float val)
{
+#if UNITY_USES_LOCATION
gLocationServiceStatus.distanceFilter = val;
+#endif
}
float LocationService::GetDistanceFilter()
{
+#if UNITY_USES_LOCATION
return gLocationServiceStatus.distanceFilter;
+#else
+ return NAN;
+#endif
}
void LocationService::StartUpdatingLocation()
{
+#if UNITY_USES_LOCATION
if (gLocationServiceStatus.locationStatus != kLocationServiceRunning)
{
CLLocationManager* locationManager = gLocationServiceStatus.GetLocationManager();
-
- // request authorization on ios8
- if ([locationManager respondsToSelector: @selector(requestWhenInUseAuthorization)])
- [locationManager performSelector: @selector(requestWhenInUseAuthorization)];
+ [locationManager requestWhenInUseAuthorization];
locationManager.desiredAccuracy = gLocationServiceStatus.desiredAccuracy;
// Set a movement threshold for new events
@@ -872,20 +894,23 @@ void LocationService::StartUpdatingLocat
gLocationServiceStatus.locationStatus = kLocationServiceInitializing;
}
+#endif
}
void LocationService::StopUpdatingLocation()
{
+#if UNITY_USES_LOCATION
if (gLocationServiceStatus.locationStatus != kLocationServiceStopped)
{
[gLocationServiceStatus.GetLocationManager() stopUpdatingLocation];
gLocationServiceStatus.locationStatus = kLocationServiceStopped;
}
+#endif
}
void LocationService::SetHeadingUpdatesEnabled(bool enabled)
{
-#if PLATFORM_IOS
+#if PLATFORM_IOS && UNITY_USES_LOCATION
if (enabled)
{
if (gLocationServiceStatus.headingStatus != kLocationServiceRunning &&
@@ -910,28 +935,41 @@ void LocationService::SetHeadingUpdatesE
bool LocationService::IsHeadingUpdatesEnabled()
{
+#if UNITY_USES_LOCATION
return (gLocationServiceStatus.headingStatus == kLocationServiceRunning);
+#else
+ return false;
+#endif
}
int UnityGetLocationStatus()
{
- return gLocationServiceStatus.locationStatus;
+#if UNITY_USES_LOCATION
+ return (LocationServiceStatus)gLocationServiceStatus.locationStatus;
+#else
+ return kLocationServiceFailed;
+#endif
}
int UnityGetHeadingStatus()
{
- return gLocationServiceStatus.headingStatus;
+#if UNITY_USES_LOCATION
+ return (LocationServiceStatus)gLocationServiceStatus.headingStatus;
+#else
+ return kLocationServiceFailed;
+#endif
}
bool LocationService::IsHeadingAvailable()
{
-#if PLATFORM_TVOS
+#if PLATFORM_IOS && UNITY_USES_LOCATION
+ return [CLLocationManager headingAvailable];
+#else
return false;
-#else
- return [CLLocationManager headingAvailable];
#endif
}
+#if UNITY_USES_LOCATION
@implementation LocationServiceDelegate
- (void)locationManager:(CLLocationManager*)manager didUpdateLocations:(NSArray*)locations
@@ -973,6 +1011,7 @@ bool LocationService::IsHeadingAvailable
}
@end
+#endif
#if PLATFORM_TVOS
misc/patches/Preprocessor.h.patch
0 → 100644
View file @
95570520
diff --git a/Classes/Preprocessor.h b/Classes/Preprocessor.h
--- a/Classes/Preprocessor.h
+++ b/Classes/Preprocessor.h
@@ -100,6 +100,7 @@
#define UNITY_USES_WEBCAM 0
#define UNITY_USES_MICROPHONE 0
#define UNITY_USES_REPLAY_KIT 0
+#define UNITY_USES_LOCATION 0
#define UNITY_SNAPSHOT_VIEW_ON_APPLICATION_PAUSE 1
#define USE_IL2CPP_PCH 0
misc/patches/iPhone_Sensors.mm.patch
0 → 100644
View file @
95570520
diff --git a/Classes/iPhone_Sensors.mm b/Classes/iPhone_Sensors.mm
--- a/Classes/iPhone_Sensors.mm
+++ b/Classes/iPhone_Sensors.mm
@@ -1,7 +1,9 @@
#define SIMULATE_ATTITUDE_FROM_GRAVITY 1
#import "iPhone_Sensors.h"
+#if UNITY_USES_LOCATION
#import <CoreLocation/CoreLocation.h>
+#endif
#if !UNITY_TVOS
#import <CoreMotion/CoreMotion.h>
#endif
@@ -752,9 +754,10 @@
extern "C" void UnityGetNiceKeyname(int
#pragma clang diagnostic pop
-
+#if UNITY_USES_LOCATION
@interface LocationServiceDelegate : NSObject<CLLocationManagerDelegate>
@end
+#endif
void
UnitySetLastLocation(double timestamp,
@@ -770,6 +773,7 @@
UnitySetLastHeading(float magneticHeadin
float rawX, float rawY, float rawZ,
double timestamp);
+#if UNITY_USES_LOCATION
struct LocationServiceInfo
{
private:
@@ -795,7 +799,9 @@
LocationServiceInfo::LocationServiceInfo
headingStatus = kLocationServiceStopped;
}
+#if UNITY_USES_LOCATION
static LocationServiceInfo gLocationServiceStatus;
+#endif
CLLocationManager* LocationServiceInfo::GetLocationManager()
{
@@ -810,40 +816,56 @@
CLLocationManager* LocationServiceInfo::
return locationManager;
}
+#endif
+
bool LocationService::IsServiceEnabledByUser()
{
+#if UNITY_USES_LOCATION
return [CLLocationManager locationServicesEnabled];
+#else
+ return false;
+#endif
}
void LocationService::SetDesiredAccuracy(float val)
{
+#if UNITY_USES_LOCATION
gLocationServiceStatus.desiredAccuracy = val;
+#endif
}
float LocationService::GetDesiredAccuracy()
{
+#if UNITY_USES_LOCATION
return gLocationServiceStatus.desiredAccuracy;
+#else
+ return NAN;
+#endif
}
void LocationService::SetDistanceFilter(float val)
{
+#if UNITY_USES_LOCATION
gLocationServiceStatus.distanceFilter = val;
+#endif
}
float LocationService::GetDistanceFilter()
{
+#if UNITY_USES_LOCATION
return gLocationServiceStatus.distanceFilter;
+#else
+ return NAN;
+#endif
}
void LocationService::StartUpdatingLocation()
{
+#if UNITY_USES_LOCATION
if (gLocationServiceStatus.locationStatus != kLocationServiceRunning)
{
CLLocationManager* locationManager = gLocationServiceStatus.GetLocationManager();
-
- // request authorization on ios8
- if ([locationManager respondsToSelector: @selector(requestWhenInUseAuthorization)])
- [locationManager performSelector: @selector(requestWhenInUseAuthorization)];
+ [locationManager requestWhenInUseAuthorization];
locationManager.desiredAccuracy = gLocationServiceStatus.desiredAccuracy;
// Set a movement threshold for new events
@@ -857,20 +879,23 @@
void LocationService::StartUpdatingLocat
gLocationServiceStatus.locationStatus = kLocationServiceInitializing;
}
+#endif
}
void LocationService::StopUpdatingLocation()
{
+#if UNITY_USES_LOCATION
if (gLocationServiceStatus.locationStatus != kLocationServiceStopped)
{
[gLocationServiceStatus.GetLocationManager() stopUpdatingLocation];
gLocationServiceStatus.locationStatus = kLocationServiceStopped;
}
+#endif
}
void LocationService::SetHeadingUpdatesEnabled(bool enabled)
{
-#if UNITY_IOS
+#if UNITY_IOS && UNITY_USES_LOCATION
if (enabled)
{
if (gLocationServiceStatus.headingStatus != kLocationServiceRunning &&
@@ -895,28 +920,41 @@
void LocationService::SetHeadingUpdatesE
bool LocationService::IsHeadingUpdatesEnabled()
{
+#if UNITY_USES_LOCATION
return (gLocationServiceStatus.headingStatus == kLocationServiceRunning);
+#else
+ return false;
+#endif
}
int UnityGetLocationStatus()
{
+#if UNITY_USES_LOCATION
return gLocationServiceStatus.locationStatus;
+#else
+ return kLocationServiceFailed;
+#endif
}
int UnityGetHeadingStatus()
{
+#if UNITY_USES_LOCATION
return gLocationServiceStatus.headingStatus;
+#else
+ return kLocationServiceFailed;
+#endif
}
bool LocationService::IsHeadingAvailable()
{
-#if UNITY_TVOS
- return false;
-#else
+#if PLATFORM_IOS && UNITY_USES_LOCATION
return [CLLocationManager headingAvailable];
+#else
+ return false;
#endif
}
+#if UNITY_USES_LOCATION
@implementation LocationServiceDelegate
- (void)locationManager:(CLLocationManager*)manager didUpdateLocations:(NSArray*)locations
@@ -958,6 +996,7 @@
bool LocationService::IsHeadingAvailable
}
@end
+#endif
#if UNITY_TVOS
GCMicroGamepad* QueryMicroController()
patches.sh
0 → 100755
View file @
95570520
#!/bin/bash
MM_PATH
=
"./misc/URLUtility.mm"
IPHONE_SDK_PATH
=
"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk"
_run_for_arch
()
{
TARGET_ARCH
=
$1
OUTPUT_PATH
=
$2
echo
"Running for
$TARGET_ARCH
to
$OUTPUT_PATH
"
lipo ./Libraries/libiPhone-lib.a
-thin
"
$TARGET_ARCH
"
-output
"
$OUTPUT_PATH
"
ar
-d
"
$OUTPUT_PATH
"
URLUtility.o
clang
-c
"
$MM_PATH
"
-arch
"
$TARGET_ARCH
"
-isysroot
"
$IPHONE_SDK_PATH
"
ar
-q
"
$OUTPUT_PATH
"
./URLUtility.o
rm
-f
./URLUtility.o
}
mkdir
/tmp/tmp-libs
_run_for_arch arm64 /tmp/tmp-libs/libiPhone-lib-arm64.a
_run_for_arch armv7 /tmp/tmp-libs/libiPhone-lib-armv7.a
_run_for_arch armv7s /tmp/tmp-libs/libiPhone-lib-armv7s.a
lipo
-create
/tmp/tmp-libs/libiPhone-lib-arm64.a /tmp/tmp-libs/libiPhone-lib-armv7.a /tmp/tmp-libs/libiPhone-lib-armv7s.a
-output
./Libraries/libiPhone-lib-new.a
# patch -p1 < ./misc/patches/iPhone_Sensors.mm.patch
# echo '#define UNITY_USES_LOCATION 0' >> ./Classes/Preprocessor.h
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