Skip to content

Commit

Permalink
fixes issues from file-format.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
LucaJunge committed Sep 2, 2024
1 parent 392701a commit 7af5cfd
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/scripts/clang_format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
set -uo pipefail
IFS=$'\n\t'

CLANG_FORMAT_FILE_EXTS=(".c" ".h" ".cpp" ".hpp" ".cc" ".hh" ".cxx" ".m" ".mm" ".inc" ".java" ".glsl")
CLANG_FORMAT_FILE_EXTS=(".c" ".h" ".cpp" ".hpp" ".cc" ".hh" ".cxx" ".m" ".mm" ".inc" ".java" ".kt" ".glsl")

# Loops through all text files tracked by Git.
git grep -zIl '' |
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@


## Usage
**Note:** [Android Studio](https://developer.android.com/studio) is the recommended IDE for
developing Godot Android plugins.
**Note:** [Android Studio](https://developer.android.com/studio) is the recommended IDE for
developing Godot Android plugins.
You can install the latest version from https://developer.android.com/studio.

Clone the repository to your local machine, run the following command in the project root
Clone the repository to your local machine, run the following command in the project root
directory to initialize the `godot-cpp` submodule:
```
git submodule update --init
Expand Down Expand Up @@ -52,7 +52,7 @@ You can use the included [Godot demo project](plugin/demo/project.godot) to test
- Open the demo in Godot (4.2 or higher)
- Navigate to `Project` -> `Project Settings...` -> `Plugins`, and ensure the plugin is enabled
- Install the Godot Android build template by clicking on `Project` -> `Install Android Build Template...`
- Open [`plugin/demo/main.gd`](plugin/demo/main.gd) and update the logic as needed to reference
- Open [`plugin/demo/main.gd`](plugin/demo/main.gd) and update the logic as needed to reference
your plugin and its methods
- Connect an Android device to your machine and run the demo on it

Expand Down Expand Up @@ -81,7 +81,7 @@ scons platform=android target=template_release arch=x86_32
scons platform=android target=template_release arch=x86_64
```

When exporting the Godot app with the plugin enabled, don't forget to add the architectures to your build.
When exporting the Godot app with the plugin enabled, don't forget to add the architectures to your build.
Open your project in the Godot Engine, navigate to `Project` -> `Export...` click on your Android Preset and under "Architectures" enable both `x86` and `x86_64`

#### Tips
Expand Down Expand Up @@ -118,13 +118,13 @@ func helloWorld():

##### Support using the gdextension functionality in the Godot Editor

If planning to use the gdextension functionality in the Godot Editor, it is recommended that the
gdextension's native binaries are compiled not just for Android, but also for the OS onto which
developers / users intend to run the Godot Editor. Not doing so may prevent developers /
If planning to use the gdextension functionality in the Godot Editor, it is recommended that the
gdextension's native binaries are compiled not just for Android, but also for the OS onto which
developers / users intend to run the Godot Editor. Not doing so may prevent developers /
users from writing code that accesses the plugin from within the Godot Editor.

This may involve creating dummy plugins for the host OS just so the API is published to the
editor. You can use the [godot-cpp-template](https://github.com/godotengine/godot-cpp-template)
This may involve creating dummy plugins for the host OS just so the API is published to the
editor. You can use the [godot-cpp-template](https://github.com/godotengine/godot-cpp-template)
github template for reference on how to do so.

## Gotchas
Expand Down
2 changes: 1 addition & 1 deletion plugin/demo/main.gd
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func _on_start_ar_button_pressed():

func get_tracking_state() -> String:
var status = ARCoreInterfaceInstance.get_tracking_status()

if status == XRInterface.XR_NOT_TRACKING:
return "Not Tracking"
elif status == XRInterface.XR_NORMAL_TRACKING:
Expand Down
2 changes: 0 additions & 2 deletions plugin/src/main/cpp/arcore_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ bool ARCoreInterface::_initialize() {
m_init_status = START_INITIALISE;

if (m_ar_session == nullptr) {

// Get the android environment
JNIEnv *env = ARCoreWrapper::get_env();

Expand Down Expand Up @@ -389,5 +388,4 @@ void ARCoreInterface::start() {
}

void ARCoreInterface::handleScreenOrientationChange() {

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import javax.microedition.khronos.egl.EGLConfig
import javax.microedition.khronos.opengles.GL10

class ARCorePlugin(godot: Godot): GodotPlugin(godot) {

companion object {
val TAG = ARCorePlugin::class.java.simpleName // TAG = "ARCorePlugin"

Expand Down

0 comments on commit 7af5cfd

Please sign in to comment.