Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,5 @@ templates/

# Switch
*.nro
*.nacp
/switch/
/config/nx-hbmenu/
switch/
config/nx-hbmenu/
44 changes: 0 additions & 44 deletions BUILDING-switch.md

This file was deleted.

57 changes: 0 additions & 57 deletions BUILDING-vita.md

This file was deleted.

56 changes: 0 additions & 56 deletions README-homebrodot.md

This file was deleted.

48 changes: 48 additions & 0 deletions README-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Godot for Switch

It's a port of the Godot open source game engine to the Switch, via homebrew libraries provided by devkitPro/switchbrew.
See the original [README.md](./README.md) for info about Godot.

## Releases

See [the GitHub releases page](https://github.com/Homebrodot/Godot/releases) for pre-built editors for Windows, macOS and
Linux.

## How do I export my game?

The editor builds above add a `Switch` exporter to the list - it will generate a .nro and a .pck file that can be
transferred to your Switch.
If additional debugging is required, sending the nro via nxlink (make sure to send it to the right place with the -p
argument) will allow the output of the console to be viewed on PC.

## How to build?

You shouldn't need to build the engine if you use a release as the templates should be included - these instructions are
for development!

[See the official docs](https://docs.godotengine.org/en/latest/development/compiling/)
for compilation instructions for every officially supported platform.

### For Switch:

Install these packages from [devkitPro pacman](https://devkitpro.org/wiki/devkitPro_pacman):
`switch-pkg-config switch-freetype switch-bulletphysics switch-libtheora switch-libpcre2 switch-mesa switch-opusfile switch-mbedtls switch-libwebp switch-libvpx switch-miniupnpc switch-libzstd switch-wslay`
then run `scons platform=switch` in the root of the repo. Add `target=release` to build for release instead of debug.

Then, to build an engine release for Switch,
run `./scripts/create-switch-release.sh` in the root of the repo.

Or to build an export template for the editor,
run `./scripts/create-switch-template.sh` in the root of the repo.

## How can I get help?

Either make an issue on this repo, or join the [Discord](https://discord.gg/yUC3rUk "Homebrodot - Godot Homebrew Hub")!

# Credits

* Thanks to devkitPro / switchbrew for producing devkitA64/libnx.
* Extra special thanks to fincs from devkitPro - This port would have never been possible without their port of the open
source nouveau graphics driver.
* cpasjuste for help with development.
* fhidalgosola/utnad for their port / help with development.
8 changes: 0 additions & 8 deletions core/os/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,10 @@ void Input::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_accelerometer"), &Input::get_accelerometer);
ClassDB::bind_method(D_METHOD("get_magnetometer"), &Input::get_magnetometer);
ClassDB::bind_method(D_METHOD("get_gyroscope"), &Input::get_gyroscope);
ClassDB::bind_method(D_METHOD("get_joy_gravity", "device"), &Input::get_joy_gravity);
ClassDB::bind_method(D_METHOD("get_joy_accelerometer", "device"), &Input::get_joy_accelerometer);
ClassDB::bind_method(D_METHOD("get_joy_magnetometer", "device"), &Input::get_joy_magnetometer);
ClassDB::bind_method(D_METHOD("get_joy_gyroscope", "device"), &Input::get_joy_gyroscope);
ClassDB::bind_method(D_METHOD("set_gravity", "value"), &Input::set_gravity);
ClassDB::bind_method(D_METHOD("set_accelerometer", "value"), &Input::set_accelerometer);
ClassDB::bind_method(D_METHOD("set_magnetometer", "value"), &Input::set_magnetometer);
ClassDB::bind_method(D_METHOD("set_gyroscope", "value"), &Input::set_gyroscope);
ClassDB::bind_method(D_METHOD("set_joy_gravity", "device", "value"), &Input::set_joy_gravity);
ClassDB::bind_method(D_METHOD("set_joy_accelerometer", "device", "value"), &Input::set_joy_accelerometer);
ClassDB::bind_method(D_METHOD("set_joy_magnetometer", "device", "value"), &Input::set_joy_magnetometer);
ClassDB::bind_method(D_METHOD("set_joy_gyroscope", "device", "value"), &Input::set_joy_gyroscope);
//ClassDB::bind_method(D_METHOD("get_mouse_position"),&Input::get_mouse_position); - this is not the function you want
ClassDB::bind_method(D_METHOD("get_last_mouse_speed"), &Input::get_last_mouse_speed);
ClassDB::bind_method(D_METHOD("get_mouse_button_mask"), &Input::get_mouse_button_mask);
Expand Down
8 changes: 0 additions & 8 deletions core/os/input.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,18 +117,10 @@ class Input : public Object {
virtual Vector3 get_accelerometer() const = 0;
virtual Vector3 get_magnetometer() const = 0;
virtual Vector3 get_gyroscope() const = 0;
virtual Vector3 get_joy_gravity(int p_device) const = 0;
virtual Vector3 get_joy_accelerometer(int p_device) const = 0;
virtual Vector3 get_joy_magnetometer(int p_device) const = 0;
virtual Vector3 get_joy_gyroscope(int p_device) const = 0;
virtual void set_gravity(const Vector3 &p_gravity) = 0;
virtual void set_accelerometer(const Vector3 &p_accel) = 0;
virtual void set_magnetometer(const Vector3 &p_magnetometer) = 0;
virtual void set_gyroscope(const Vector3 &p_gyroscope) = 0;
virtual void set_joy_gravity(int p_device, const Vector3 &p_gravity) = 0;
virtual void set_joy_accelerometer(int p_device, const Vector3 &p_accel) = 0;
virtual void set_joy_magnetometer(int p_device, const Vector3 &p_magnetometer) = 0;
virtual void set_joy_gyroscope(int p_device, const Vector3 &p_gyroscope) = 0;

virtual void action_press(const StringName &p_action, float p_strength = 1.f) = 0;
virtual void action_release(const StringName &p_action) = 0;
Expand Down
4 changes: 0 additions & 4 deletions doc/classes/@GlobalScope.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@
<member name="NavigationServer" type="NavigationServer" setter="" getter="">
The [NavigationServer] singleton.
</member>
<member name="NintendoSwitch" type="NintendoSwitch" setter="" getter="">
The [NintendoSwitch] singleton.
[b]Note:[/b] Only implemented on Nintendo Switch.
</member>
<member name="OS" type="OS" setter="" getter="">
The [OS] singleton.
</member>
Expand Down
70 changes: 2 additions & 68 deletions doc/classes/Input.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,6 @@
[b]Note:[/b] This method only works on Android and iOS. On other platforms, it always returns [constant Vector3.ZERO].
</description>
</method>
<method name="get_joy_accelerometer" qualifiers="const">
<return type="Vector3" />
<argument index="0" name="device" type="int" />
<description>
Returns the acceleration of the controller's accelerometer sensor, if the controller has one. Otherwise, the method returns [constant Vector3.ZERO].
</description>
</method>
<method name="get_joy_axis" qualifiers="const">
<return type="float" />
<argument index="0" name="device" type="int" />
Expand Down Expand Up @@ -148,34 +141,13 @@
Receives a gamepad button from [enum JoystickList] and returns its equivalent name as a string.
</description>
</method>
<method name="get_joy_gravity" qualifiers="const">
<return type="Vector3" />
<argument index="0" name="device" type="int" />
<description>
Returns the gravity of the controller's accelerometer sensor, if the controller has one. Otherwise, the method returns [constant Vector3.ZERO].
</description>
</method>
<method name="get_joy_guid" qualifiers="const">
<return type="String" />
<argument index="0" name="device" type="int" />
<description>
Returns a SDL2-compatible device GUID on platforms that use gamepad remapping, e.g. [code]030000004c050000c405000000010000[/code]. Returns [code]"Default Gamepad"[/code] otherwise. Godot uses the [url=https://github.com/gabomdq/SDL_GameControllerDB]SDL2 game controller database[/url] to determine gamepad names and mappings based on this GUID.
</description>
</method>
<method name="get_joy_gyroscope" qualifiers="const">
<return type="Vector3" />
<argument index="0" name="device" type="int" />
<description>
Returns the rotation rate in rad/s around a controller's X, Y, and Z axes of the gyroscope sensor, if the controller has one. Otherwise, the method returns [constant Vector3.ZERO].
</description>
</method>
<method name="get_joy_magnetometer" qualifiers="const">
<return type="Vector3" />
<argument index="0" name="device" type="int" />
<description>
Returns the magnetic field strength in micro-Tesla for all axes of the controller's magnetometer sensor, if the controller has one. Otherwise, the method returns [constant Vector3.ZERO].
</description>
</method>
<method name="get_joy_name">
<return type="String" />
<argument index="0" name="device" type="int" />
Expand Down Expand Up @@ -374,53 +346,15 @@
<return type="void" />
<argument index="0" name="value" type="Vector3" />
<description>
Sets the value of the rotation rate of the device's gyroscope sensor.
Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC.
Sets the value of the rotation rate of the gyroscope sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC.
[b]Note:[/b] This value can be immediately overwritten by the hardware sensor value on Android and iOS.
</description>
</method>
<method name="set_joy_accelerometer">
<return type="void" />
<argument index="0" name="device" type="int" />
<argument index="1" name="value" type="Vector3" />
<description>
Sets the acceleration value of the controller's accelerometer sensor.
Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC.
</description>
</method>
<method name="set_joy_gravity">
<return type="void" />
<argument index="0" name="device" type="int" />
<argument index="1" name="value" type="Vector3" />
<description>
Sets the gravity value of the controller's accelerometer sensor.
Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC.
</description>
</method>
<method name="set_joy_gyroscope">
<return type="void" />
<argument index="0" name="device" type="int" />
<argument index="1" name="value" type="Vector3" />
<description>
Sets the value of the rotation rate of the controller's gyroscope sensor.
Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC.
</description>
</method>
<method name="set_joy_magnetometer">
<return type="void" />
<argument index="0" name="device" type="int" />
<argument index="1" name="value" type="Vector3" />
<description>
Sets the value of the magnetic field of the controller's magnetometer sensor.
Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC.
</description>
</method>
<method name="set_magnetometer">
<return type="void" />
<argument index="0" name="value" type="Vector3" />
<description>
Sets the value of the magnetic field of the device's magnetometer sensor.
Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC.
Sets the value of the magnetic field of the magnetometer sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC.
[b]Note:[/b] This value can be immediately overwritten by the hardware sensor value on Android and iOS.
</description>
</method>
Expand Down
Loading