-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add player, controller, debug stuff.
Squashed commit of the following: commit 529893cee8d90aa41a497181fd7d70332a1f844f Author: Karn Kaul <[email protected]> Date: Wed Feb 28 20:04:57 2024 +0530 Cleanup spaced. commit 5f735b0d98c61b5779d1a7ede9d0821d10aad8be Author: Karn Kaul <[email protected]> Date: Wed Feb 28 20:00:39 2024 +0530 bave stable 0.4.4. commit 08488b8a9fe51ce12f851ed17fcb68b178598552 Author: Karn Kaul <[email protected]> Date: Wed Feb 28 19:59:25 2024 +0530 Add CI scripts. commit b90d5e8b15e7f8c6db423711979d00acfbde8e26 Author: Karn Kaul <[email protected]> Date: Wed Feb 28 19:44:14 2024 +0530 Aggregate pointer and gamepad input. commit c93a4ea449adbd5c8bbb5a12f05fe2ed4615b598 Author: Karn Kaul <[email protected]> Date: Tue Feb 27 18:03:44 2024 +0530 [android] enable both landscape orientations. commit 237ab692230a68e6f252935273c3354fb996640b Author: Karn Kaul <[email protected]> Date: Tue Feb 27 17:56:03 2024 +0530 Add `SpringArm`. commit 8437a7868f8d25b54703f127c555b018d6928bc9 Author: Karn Kaul <[email protected]> Date: Tue Feb 27 13:00:23 2024 +0530 Add debug stuff. commit a6eb411ca90730e1baa132e919a9ff5db198aa53 Author: Karn Kaul <[email protected]> Date: Tue Feb 27 11:58:10 2024 +0530 bave update commit 1f36cb91fa041e053df49c6cbfc2d579d57a7f13 Author: Karn Kaul <[email protected]> Date: Tue Feb 27 02:08:25 2024 +0530 Add `PlayerController`, `GamepadProvider`. - bave unstable. commit c9e51859d2d2c17df3621e8d222cdc3b94defacc Author: Karn Kaul <[email protected]> Date: Mon Feb 26 22:51:06 2024 +0530 Add `Player`, `Game`; improve `ISceneSwitcher`.
- Loading branch information
Showing
56 changed files
with
3,399 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
[[ ! $(git --version) ]] && exit 1 | ||
|
||
output=$(git diff --name-only) | ||
|
||
if [[ "$output" != "" ]]; then | ||
echo -e "One or more source files are not formatted!\n\n$output\n" | ||
exit 1 | ||
fi | ||
|
||
echo "All source files are formatted" | ||
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: ci | ||
on: [push] | ||
jobs: | ||
build-linux: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: init | ||
run: sudo apt update -yqq && sudo apt install -yqq ninja-build xorg-dev g++-13 clang-15 | ||
- name: configure gcc | ||
run: cmake -S . --preset=default -B build -DBAVE_BUILD_SHADERS=OFF -DBAVE_USE_FREETYPE=OFF -DCAPO_USE_OPENAL=OFF -DCMAKE_CXX_COMPILER=g++-13 | ||
- name: configure clang | ||
run: cmake -S . --preset=default -B clang -DBAVE_BUILD_SHADERS=OFF -DBAVE_USE_FREETYPE=OFF -DCAPO_USE_OPENAL=OFF -DCMAKE_CXX_COMPILER=clang++-15 | ||
- name: build gcc | ||
run: cmake --build build --config=Release -- -d explain | ||
- name: build clang | ||
run: cmake --build clang --config=Release | ||
- name: test | ||
run: cd build && ctest -C Release | ||
build-windows: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: configure | ||
run: cmake -S . --preset=vs22 -B build -DBAVE_BUILD_SHADERS=OFF -DBAVE_USE_FREETYPE=OFF -DCAPO_USE_OPENAL=OFF | ||
- name: build | ||
run: cmake --build build --config=Release | ||
- name: test | ||
run: cd build && ctest -C Release | ||
build-macos: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: init | ||
run: brew install ninja | ||
- name: configure | ||
run: cmake -S . --preset=default -B build -DBAVE_BUILD_SHADERS=OFF -DBAVE_USE_FREETYPE=OFF -DCAPO_USE_OPENAL=OFF | ||
- name: build | ||
run: cmake --build build --config=Release -- -d explain | ||
- name: test | ||
run: cd build && ctest -C Release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: ci | ||
on: [push] | ||
jobs: | ||
format-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: update clang-format | ||
run: sudo apt install clang-15 | ||
- name: format code | ||
run: tools/format_code.sh | ||
- name: check diff | ||
run: .github/format_check_diff.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
/.idea/caches | ||
/.idea/libraries | ||
/.idea/modules.xml | ||
/.idea/workspace.xml | ||
/.idea/navEditor.xml | ||
/.idea/assetWizardSettings.xml | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild | ||
.cxx | ||
local.properties | ||
|
||
/.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
plugins { | ||
alias(libs.plugins.androidApplication) | ||
alias(libs.plugins.jetbrainsKotlinAndroid) | ||
} | ||
|
||
android { | ||
namespace = "com.karnage.spaced" | ||
compileSdk = 34 | ||
|
||
defaultConfig { | ||
applicationId = "com.karnage.spaced" | ||
minSdk = 28 | ||
targetSdk = 34 | ||
versionCode = 1 | ||
versionName = "1.0" | ||
|
||
ndk { | ||
abiFilters.add("arm64-v8a") | ||
abiFilters.add("x86_64") | ||
} | ||
} | ||
|
||
buildTypes { | ||
release { | ||
isMinifyEnabled = false | ||
proguardFiles( | ||
getDefaultProguardFile("proguard-android-optimize.txt"), | ||
"proguard-rules.pro" | ||
) | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
} | ||
externalNativeBuild { | ||
cmake { | ||
path = file("src/main/cpp/CMakeLists.txt") | ||
version = "3.22.1" | ||
} | ||
} | ||
ndkVersion = "26.1.10909125" | ||
} | ||
|
||
dependencies { | ||
|
||
implementation(libs.androidx.core.ktx) | ||
implementation(libs.androidx.appcompat) | ||
implementation(libs.material) | ||
testImplementation(libs.junit) | ||
androidTestImplementation(libs.androidx.junit) | ||
androidTestImplementation(libs.androidx.espresso.core) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/assets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools"> | ||
|
||
<application | ||
android:allowBackup="true" | ||
android:dataExtractionRules="@xml/data_extraction_rules" | ||
android:fullBackupContent="@xml/backup_rules" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@style/Theme.Hog" | ||
tools:targetApi="31"> | ||
|
||
<activity android:name="android.app.NativeActivity" | ||
android:screenOrientation="userLandscape" | ||
android:label="@string/app_name" | ||
android:exported="true"> | ||
<meta-data | ||
android:name="android.app.lib_name" | ||
android:value="spaced-android" /> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
cmake_minimum_required(VERSION 3.22) | ||
|
||
project(spaced-android) | ||
|
||
set(spaced_path ../../../../../../) | ||
file(REAL_PATH ${spaced_path} spaced_path) | ||
add_subdirectory(${spaced_path} "${CMAKE_CURRENT_BINARY_DIR}/spaced") | ||
|
||
add_library(${PROJECT_NAME} SHARED) | ||
|
||
target_link_libraries(${PROJECT_NAME} PRIVATE | ||
spaced::lib | ||
) | ||
|
||
target_sources(${PROJECT_NAME} PRIVATE | ||
main.cpp | ||
) | ||
|
||
add_custom_target(copy-assets ALL | ||
${CMAKE_COMMAND} -E remove_directory "${CMAKE_CURRENT_SOURCE_DIR}/../assets" | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory "${spaced_path}/assets" "${CMAKE_CURRENT_SOURCE_DIR}/../assets" | ||
) | ||
|
||
add_dependencies(${PROJECT_NAME} copy-assets) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <bave/android_app.hpp> | ||
#include <spaced/spaced.hpp> | ||
|
||
extern "C" { | ||
// Android entry point: must have C linkage. | ||
void android_main(android_app* andr_app) { | ||
// we will use bave::AndroidApp. | ||
// create the App instance. | ||
auto app = bave::AndroidApp{*andr_app, vk::SampleCountFlagBits::e4}; | ||
// setup the entry point (Flappy). | ||
app.set_bootloader([](bave::App& app) { return std::make_unique<spaced::Spaced>(app); }); | ||
// run App and return its exit code. | ||
// after its own setup, App will create Flappy (via the factory passed above) and drive it every frame. | ||
app.run(); | ||
} | ||
} |
Oops, something went wrong.