Skip to content

Commit

Permalink
Merge branch 'UpsilonNumworks:upsilon-dev' into upsilon-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
cartoone222 authored Jun 10, 2024
2 parents 15225a0 + ff54918 commit 28525de
Show file tree
Hide file tree
Showing 13 changed files with 113 additions and 72 deletions.
8 changes: 2 additions & 6 deletions ion/src/shared/events_keyboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ void resetLongRepetition() {
ComputeAndSetRepetitionFactor(sEventRepetitionCount);
}

static Keyboard::Key keyFromState(Keyboard::State state) {
return static_cast<Keyboard::Key>(63 - __builtin_clzll(state));
}

static inline Event innerGetEvent(int * timeout) {
assert(*timeout > delayBeforeRepeat);
assert(*timeout > delayBetweenRepeat);
Expand Down Expand Up @@ -96,7 +92,7 @@ static inline Event innerGetEvent(int * timeout) {
}

bool lock = isLockActive();

if ( key == Keyboard::Key::Left
|| key == Keyboard::Key::Right
|| key == Keyboard::Key::Up
Expand All @@ -108,7 +104,7 @@ static inline Event innerGetEvent(int * timeout) {
// shift = false;
}
}

Event event(key, shift, alpha, lock);
sLastEventShift = shift;
sLastEventAlpha = alpha;
Expand Down
6 changes: 5 additions & 1 deletion ion/src/simulator/android/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ $(BUILD_DIR)/app/res/mipmap-v26/ic_launcher_foreground.png: ion/src/simulator/as
$(call rule_label,CONVERT)
$(Q) convert -background none $< -resize 1024x1024 -gravity center -background none -extent 1024x1024 $@

$(BUILD_DIR)/app/res/mipmap-v26/ic_launcher_monochrome.png: ion/src/simulator/assets/logo_monochrome.svg | $$(@D)/.
$(call rule_label,CONVERT)
$(Q) convert -background none $< -resize 1024x1024 -gravity center -background none -extent 1024x1024 $@

$(BUILD_DIR)/app/res/%.xml: ion/src/simulator/android/src/res/%.xml | $$(@D)/.
$(call rule_label,COPY)
$(Q) cp $< $@
Expand All @@ -58,7 +62,7 @@ $(foreach ARCH,$(ARCHS),$(eval $(call rule_for_arch_jni_lib,$(ARCH))))

apk_deps = $(foreach ARCH,$(ARCHS),$(call path_for_arch_jni_lib,$(ARCH)))
apk_deps += $(subst ion/src/simulator/android/src/res,$(BUILD_DIR)/app/res,$(wildcard ion/src/simulator/android/src/res/*/*))
apk_deps += $(addprefix $(BUILD_DIR)/app/res/,mipmap/ic_launcher.png mipmap-v26/ic_launcher_foreground.png)
apk_deps += $(addprefix $(BUILD_DIR)/app/res/,mipmap/ic_launcher.png mipmap-v26/ic_launcher_foreground.png mipmap-v26/ic_launcher_monochrome.png)

.PRECIOUS: $(apk_deps)

Expand Down
2 changes: 1 addition & 1 deletion ion/src/simulator/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 29
defaultConfig {
applicationId "io.github.omega.simulator"
applicationId "io.github.upsilon.simulator"
minSdkVersion 16
targetSdkVersion 29
def (major, minor, patch) = System.getenv('OMEGA_VERSION').toLowerCase().tokenize('.').collect{it.toInteger()}
Expand Down
10 changes: 5 additions & 5 deletions ion/src/simulator/android/src/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.github.omega.simulator"
package="io.github.upsilon.simulator"
android:installLocation="auto">

<uses-feature android:glEsVersion="0x00020000" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
<uses-feature android:name="android.hardware.gamepad" android:required="false" />
<uses-feature android:name="android.hardware.type.pc" android:required="false" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> -->
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<!-- <uses-permission android:name="android.permission.INTERNET"/> -->
<!-- <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> -->

<application android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:allowBackup="true"
android:theme="@style/AppTheme"
android:hardwareAccelerated="true" >

<activity android:name="OmegaActivity"
<activity android:name="UpsilonActivity"
android:label="@string/app_name"
android:alwaysRetainTaskState="true"
android:launchMode="singleInstance"
Expand Down
2 changes: 1 addition & 1 deletion ion/src/simulator/android/src/cpp/haptics_enabled.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Haptics {
bool isEnabled() {
JNIEnv * env = static_cast<JNIEnv *>(SDL_AndroidGetJNIEnv());
jobject activity = static_cast<jobject>(SDL_AndroidGetActivity());
jclass j_class = env->FindClass("io/github/omega/simulator/OmegaActivity");
jclass j_class = env->FindClass("io/github/upsilon/simulator/UpsilonActivity");
jmethodID j_methodId = env->GetMethodID(j_class,"hapticFeedbackIsEnabled", "()Z");
assert(j_methodId != 0);
bool result = (env->CallBooleanMethod(activity, j_methodId) != JNI_FALSE);
Expand Down
2 changes: 1 addition & 1 deletion ion/src/simulator/android/src/cpp/platform_images.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SDL_Texture * loadImage(SDL_Renderer * renderer, const char * identifier) {
JNIEnv * env = static_cast<JNIEnv *>(SDL_AndroidGetJNIEnv());
jobject activity = static_cast<jobject>(SDL_AndroidGetActivity());

jclass j_class = env->FindClass("io/github/omega/simulator/OmegaActivity");
jclass j_class = env->FindClass("io/github/upsilon/simulator/UpsilonActivity");
jmethodID j_methodId = env->GetMethodID(
j_class,
"retrieveBitmapAsset",
Expand Down
2 changes: 1 addition & 1 deletion ion/src/simulator/android/src/cpp/platform_language.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const char * languageCode() {
JNIEnv * env = static_cast<JNIEnv *>(SDL_AndroidGetJNIEnv());
jobject activity = static_cast<jobject>(SDL_AndroidGetActivity());

jclass j_class = env->FindClass("io/github/omega/simulator/OmegaActivity");
jclass j_class = env->FindClass("io/github/upsilon/simulator/UpsilonActivity");
jmethodID j_methodId = env->GetMethodID(
j_class,
"retrieveLanguage",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.omega.simulator;
package io.github.upsilon.simulator;

import java.util.Locale;

Expand All @@ -18,7 +18,7 @@
import org.libsdl.app.SDLActivity;
import org.libsdl.app.SDL;

public class OmegaActivity extends SDLActivity {
public class UpsilonActivity extends SDLActivity {
protected String[] getLibraries() {
return new String[] {
"epsilon"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/yellow" />
<foreground android:drawable="@mipmap/ic_launcher_foreground" />
<monochrome android:drawable="@mipmap/ic_launcher_monochrome" />
</adaptive-icon>
2 changes: 1 addition & 1 deletion ion/src/simulator/android/src/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="yellow">#C03535</color>
<color name="yellow">#5c83ab</color>
<color name="lightGray">#F7F7F7</color>
</resources>
2 changes: 1 addition & 1 deletion ion/src/simulator/android/src/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">Omega</string>
<string name="app_name">Upsilon</string>
</resources>
100 changes: 48 additions & 52 deletions ion/src/simulator/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 28525de

Please sign in to comment.