Skip to content

Commit

Permalink
Various small fixes and bump dependency versions and app version, ena…
Browse files Browse the repository at this point in the history
…ble x86_64
  • Loading branch information
levinli303 committed Apr 8, 2022
1 parent 5820928 commit 99bb0f4
Show file tree
Hide file tree
Showing 16 changed files with 40 additions and 49 deletions.
4 changes: 4 additions & 0 deletions Celestia/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ android {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64'
}
}
}

Expand Down
3 changes: 3 additions & 0 deletions Celestia/src/main/cpp/gamesdk/include/common/gamesdk_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@
#define ANDROID_GAMESDK_MAJOR_VERSION(PACKED) ((PACKED) >> 16)
#define ANDROID_GAMESDK_MINOR_VERSION(PACKED) ((PACKED)&0xff)
#define ANDROID_GAMESDK_BUGFIX_VERSION(PACKED) (((PACKED) >> 8) & 0xff)

#define AGDK_STRING_VERSION(MAJOR, MINOR, BUGFIX, GIT) \
#MAJOR "." #MINOR "." #BUGFIX "." #GIT
11 changes: 1 addition & 10 deletions Celestia/src/main/cpp/gamesdk/include/swappy/swappyGL.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
extern "C" {
#endif

// Internal init function. Do not call directly.
bool SwappyGL_init_internal(JNIEnv *env, jobject jactivity);

/**
* @brief Initialize Swappy, getting the required Android parameters from the
* display subsystem via JNI.
Expand All @@ -44,13 +41,7 @@ bool SwappyGL_init_internal(JNIEnv *env, jobject jactivity);
* @return false if Swappy failed to initialize.
* @see SwappyGL_destroy
*/
static inline bool SwappyGL_init(JNIEnv *env, jobject jactivity) {
// This call ensures that the header and the linked library are from the
// same version (if not, a linker error will be triggered because of an
// undefined symbolP).
SWAPPY_VERSION_SYMBOL();
return SwappyGL_init_internal(env, jactivity);
}
bool SwappyGL_init(JNIEnv *env, jobject jactivity);

/**
* @brief Check if Swappy was successfully initialized.
Expand Down
4 changes: 4 additions & 0 deletions Celestia/src/main/cpp/gamesdk/include/swappy/swappyGL_extra.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ void SwappyGL_recordFrameStart(EGLDisplay display, EGLSurface surface);
*/
void SwappyGL_getStats(SwappyStats *swappyStats);

/** @brief Remove callbacks that were previously added using
* SwappyGL_injectTracer. */
void SwappyGL_uninjectTracer(const SwappyTracer *t);

#ifdef __cplusplus
};
#endif
Expand Down
15 changes: 5 additions & 10 deletions Celestia/src/main/cpp/gamesdk/include/swappy/swappyVk.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,11 @@ bool SwappyVk_initAndGetRefreshCycleDuration_internal(
* @return bool - true if the value returned by pRefreshDuration is
* valid, otherwise false if an error.
*/
static inline bool SwappyVk_initAndGetRefreshCycleDuration(
JNIEnv* env, jobject jactivity, VkPhysicalDevice physicalDevice,
VkDevice device, VkSwapchainKHR swapchain, uint64_t* pRefreshDuration) {
// This call ensures that the header and the linked library are from the
// same version (if not, a linker error will be triggered because of an
// undefined symbol).
SWAPPY_VERSION_SYMBOL();
return SwappyVk_initAndGetRefreshCycleDuration_internal(
env, jactivity, physicalDevice, device, swapchain, pRefreshDuration);
}
bool SwappyVk_initAndGetRefreshCycleDuration(JNIEnv* env, jobject jactivity,
VkPhysicalDevice physicalDevice,
VkDevice device,
VkSwapchainKHR swapchain,
uint64_t* pRefreshDuration);

/**
* @brief Tell Swappy which ANativeWindow to use when calling to ANativeWindow_*
Expand Down
33 changes: 15 additions & 18 deletions Celestia/src/main/cpp/gamesdk/include/swappy/swappy_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,22 @@

// Internal macros to track Swappy version, do not use directly.
#define SWAPPY_MAJOR_VERSION 1
#define SWAPPY_MINOR_VERSION 9
#define SWAPPY_MINOR_VERSION 10
#define SWAPPY_BUGFIX_VERSION 0
#define SWAPPY_PACKED_VERSION \
ANDROID_GAMESDK_PACKED_VERSION(SWAPPY_MAJOR_VERSION, SWAPPY_MINOR_VERSION, \
SWAPPY_BUGFIX_VERSION)

// Internal macros to generate a symbol to track Swappy version, do not use
// directly.
#define SWAPPY_VERSION_CONCAT_NX(PREFIX, MAJOR, MINOR, BUGFIX) \
PREFIX##_##MAJOR##_##MINOR##_##BUGFIX
#define SWAPPY_VERSION_CONCAT(PREFIX, MAJOR, MINOR, BUGFIX) \
SWAPPY_VERSION_CONCAT_NX(PREFIX, MAJOR, MINOR, BUGFIX)
#define SWAPPY_VERSION_SYMBOL \
SWAPPY_VERSION_CONCAT(Swappy_version, SWAPPY_MAJOR_VERSION, \
SWAPPY_MINOR_VERSION, SWAPPY_BUGFIX_VERSION)
#define SWAPPY_VERSION_CONCAT_NX(PREFIX, MAJOR, MINOR, BUGFIX, GITCOMMIT) \
PREFIX##_##MAJOR##_##MINOR##_##BUGFIX##_##GITCOMMIT
#define SWAPPY_VERSION_CONCAT(PREFIX, MAJOR, MINOR, BUGFIX, GITCOMMIT) \
SWAPPY_VERSION_CONCAT_NX(PREFIX, MAJOR, MINOR, BUGFIX, GITCOMMIT)
#define SWAPPY_VERSION_SYMBOL \
SWAPPY_VERSION_CONCAT(Swappy_version, SWAPPY_MAJOR_VERSION, \
SWAPPY_MINOR_VERSION, SWAPPY_BUGFIX_VERSION, \
AGDK_GIT_COMMIT)

/** @endcond */

Expand Down Expand Up @@ -100,16 +101,6 @@ typedef struct SwappyThreadFunctions {
extern "C" {
#endif

/** @cond INTERNAL */

// Internal function to track Swappy version bundled in a binary. Do not call
// directly. If you are getting linker errors related to Swappy_version_x_y, you
// probably have a mismatch between the header used at compilation and the
// actually library used by the linker.
void SWAPPY_VERSION_SYMBOL();

/** @endcond */

/**
* @brief Return the version of the Swappy library at runtime.
*/
Expand All @@ -125,6 +116,12 @@ uint32_t Swappy_version();
*/
void Swappy_setThreadFunctions(const SwappyThreadFunctions* thread_functions);

/**
* @brief Return the full version of the Swappy library at runtime, e.g.
* "1.9.0_8a85ab7c46"
*/
const char* Swappy_versionString();

#ifdef __cplusplus
} // extern "C"
#endif
Expand Down
Binary file modified Celestia/src/main/cpp/gamesdk/libs/arm64-v8a/libswappy_static.a
Binary file not shown.
Binary file not shown.
Binary file modified Celestia/src/main/cpp/gamesdk/libs/x86/libswappy_static.a
Binary file not shown.
Binary file modified Celestia/src/main/cpp/gamesdk/libs/x86_64/libswappy_static.a
Binary file not shown.
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a'
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64'
}
}
}
Expand Down Expand Up @@ -101,12 +101,12 @@ dependencies {
implementation "androidx.fragment:fragment-ktx:1.4.1"

implementation "com.google.android.material:material:$material_version"
implementation "com.google.code.gson:gson:2.8.9"
implementation "com.google.code.gson:gson:2.9.0"
implementation "com.squareup.retrofit2:retrofit:2.9.0"
implementation "com.squareup.retrofit2:converter-gson:2.9.0"
implementation "com.squareup.okhttp3:okhttp:4.9.3"

implementation "net.lingala.zip4j:zip4j:2.9.1"
implementation "net.lingala.zip4j:zip4j:2.10.0"

implementation 'androidx.webkit:webkit:1.4.0'

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
xmlns:tools="http://schemas.android.com/tools"
package="space.celestia.mobilecelestia"
android:installLocation="auto"
android:versionCode="263"
android:versionName="1.5.7">
android:versionCode="264"
android:versionName="1.5.8">

<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<uses-permission android:name="android.permission.INTERNET"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ fun List<CommonSectionV2>.transformed(): List<CommonSection> {
for (indexedSection in this.withIndex()) {
val index = indexedSection.index
val section = indexedSection.value
val spaceAdded = false
val showHeader = section.header != null && section.header != ""
val showFooter = section.footer != null && section.footer != ""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ class EventFinderInputFragment : NavigationFragment.SubFragment() {
val ac = context as? Activity ?: return@EventFinderInputRecyclerViewAdapter
val objects = listOf(AppCore.getLocalizedString("Earth", "celestia-data"), AppCore.getLocalizedString("Jupiter", "celestia-data"))
val other = CelestiaString("Other", "")
val currentIndex = 0.coerceAtLeast(objects.indexOf(current))
ac.showOptions(CelestiaString("Please choose an object.", ""), (objects + other).toTypedArray()) { index ->
if (index >= objects.size) {
// User choose other, show text input for the object name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ class GoToInputFragment : NavigationFragment.SubFragment() {
listener?.onEditGoToObject(goToData)
}, chooseUnitCallback = { current ->
val ac = activity ?: return@GoToInputRecyclerViewAdapter
val index = distanceUnits.indexOf(current)
ac.showOptions("", distanceUnits.map { value -> CelestiaString(value.name, "") }.toTypedArray(),) { newIndex ->
val unit = distanceUnits[newIndex]
adapter?.unit = unit
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ buildscript {
ext.core_ktx_version = '1.7.0'
ext.core_appcompat_version = '1.4.1'
ext.material_version = '1.5.0'
ext.glide_version = '4.12.0'
ext.kotlinx_coroutines_version = '1.6.0'
ext.glide_version = '4.13.1'
ext.kotlinx_coroutines_version = '1.6.1'

repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath 'com.android.tools.build:gradle:7.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.dagger:hilt-android-gradle-plugin:2.38.1'
}
Expand Down

0 comments on commit 99bb0f4

Please sign in to comment.