Skip to content

Commit b4c4818

Browse files
committed
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`.
1 parent 302f979 commit b4c4818

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+3399
-153
lines changed

.github/format_check_diff.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
[[ ! $(git --version) ]] && exit 1
4+
5+
output=$(git diff --name-only)
6+
7+
if [[ "$output" != "" ]]; then
8+
echo -e "One or more source files are not formatted!\n\n$output\n"
9+
exit 1
10+
fi
11+
12+
echo "All source files are formatted"
13+
exit

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: ci
2+
on: [push]
3+
jobs:
4+
build-linux:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v4
8+
- name: init
9+
run: sudo apt update -yqq && sudo apt install -yqq ninja-build xorg-dev g++-13 clang-15
10+
- name: configure gcc
11+
run: cmake -S . --preset=default -B build -DBAVE_BUILD_SHADERS=OFF -DBAVE_USE_FREETYPE=OFF -DCAPO_USE_OPENAL=OFF -DCMAKE_CXX_COMPILER=g++-13
12+
- name: configure clang
13+
run: cmake -S . --preset=default -B clang -DBAVE_BUILD_SHADERS=OFF -DBAVE_USE_FREETYPE=OFF -DCAPO_USE_OPENAL=OFF -DCMAKE_CXX_COMPILER=clang++-15
14+
- name: build gcc
15+
run: cmake --build build --config=Release -- -d explain
16+
- name: build clang
17+
run: cmake --build clang --config=Release
18+
- name: test
19+
run: cd build && ctest -C Release
20+
build-windows:
21+
runs-on: windows-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: configure
25+
run: cmake -S . --preset=vs22 -B build -DBAVE_BUILD_SHADERS=OFF -DBAVE_USE_FREETYPE=OFF -DCAPO_USE_OPENAL=OFF
26+
- name: build
27+
run: cmake --build build --config=Release
28+
- name: test
29+
run: cd build && ctest -C Release
30+
build-macos:
31+
runs-on: macos-latest
32+
steps:
33+
- uses: actions/checkout@v4
34+
- name: init
35+
run: brew install ninja
36+
- name: configure
37+
run: cmake -S . --preset=default -B build -DBAVE_BUILD_SHADERS=OFF -DBAVE_USE_FREETYPE=OFF -DCAPO_USE_OPENAL=OFF
38+
- name: build
39+
run: cmake --build build --config=Release -- -d explain
40+
- name: test
41+
run: cd build && ctest -C Release

.github/workflows/format_check.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: ci
2+
on: [push]
3+
jobs:
4+
format-check:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v4
8+
- name: update clang-format
9+
run: sudo apt install clang-15
10+
- name: format code
11+
run: tools/format_code.sh
12+
- name: check diff
13+
run: .github/format_check_diff.sh

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ include(FetchContent)
1111
FetchContent_Declare(
1212
bave
1313
GIT_REPOSITORY https://github.com/karnkaul/bave
14-
GIT_TAG 26b2d5ecdc119fda3524e454fa304bcb75e8f595 # v0.4.3
14+
GIT_TAG b8dd8a003276fbe21af477da2d2a58d3251ef473 # v0.4.4
1515
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ext/bave"
1616
)
1717

assets/gamecontrollerdb.txt

Lines changed: 2019 additions & 0 deletions
Large diffs are not rendered by default.

src/android/.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/caches
5+
/.idea/libraries
6+
/.idea/modules.xml
7+
/.idea/workspace.xml
8+
/.idea/navEditor.xml
9+
/.idea/assetWizardSettings.xml
10+
.DS_Store
11+
/build
12+
/captures
13+
.externalNativeBuild
14+
.cxx
15+
local.properties
16+
17+
/.idea

src/android/app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

src/android/app/build.gradle.kts

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
plugins {
2+
alias(libs.plugins.androidApplication)
3+
alias(libs.plugins.jetbrainsKotlinAndroid)
4+
}
5+
6+
android {
7+
namespace = "com.karnage.spaced"
8+
compileSdk = 34
9+
10+
defaultConfig {
11+
applicationId = "com.karnage.spaced"
12+
minSdk = 28
13+
targetSdk = 34
14+
versionCode = 1
15+
versionName = "1.0"
16+
17+
ndk {
18+
abiFilters.add("arm64-v8a")
19+
abiFilters.add("x86_64")
20+
}
21+
}
22+
23+
buildTypes {
24+
release {
25+
isMinifyEnabled = false
26+
proguardFiles(
27+
getDefaultProguardFile("proguard-android-optimize.txt"),
28+
"proguard-rules.pro"
29+
)
30+
}
31+
}
32+
compileOptions {
33+
sourceCompatibility = JavaVersion.VERSION_1_8
34+
targetCompatibility = JavaVersion.VERSION_1_8
35+
}
36+
kotlinOptions {
37+
jvmTarget = "1.8"
38+
}
39+
externalNativeBuild {
40+
cmake {
41+
path = file("src/main/cpp/CMakeLists.txt")
42+
version = "3.22.1"
43+
}
44+
}
45+
ndkVersion = "26.1.10909125"
46+
}
47+
48+
dependencies {
49+
50+
implementation(libs.androidx.core.ktx)
51+
implementation(libs.androidx.appcompat)
52+
implementation(libs.material)
53+
testImplementation(libs.junit)
54+
androidTestImplementation(libs.androidx.junit)
55+
androidTestImplementation(libs.androidx.espresso.core)
56+
}

src/android/app/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile

src/android/app/src/main/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/assets

0 commit comments

Comments
 (0)