Skip to content

Commit

Permalink
- use AuroraOS as target OS in port
Browse files Browse the repository at this point in the history
- add default icons paths to export default settings
  • Loading branch information
savegame committed Jun 16, 2024
1 parent d73b898 commit 2b6ec2b
Show file tree
Hide file tree
Showing 33 changed files with 212 additions and 214 deletions.
14 changes: 7 additions & 7 deletions drivers/gles2/rasterizer_canvas_base_gles2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ void RasterizerCanvasBaseGLES2::canvas_begin() {
state.canvas_shader.set_conditional(CanvasShaderGLES2::USE_ATTRIB_LIGHT_ANGLE, false);
state.canvas_shader.set_conditional(CanvasShaderGLES2::USE_ATTRIB_MODULATE, false);
state.canvas_shader.set_conditional(CanvasShaderGLES2::USE_ATTRIB_LARGE_VERTEX, false);
#if SAILFISH_FORCE_LANDSCAPE && SAILFISH_ENABLED
WARN_PRINT_ONCE("Force Sailfish landscape mode enabled");
#if AURORAOS_FORCE_LANDSCAPE && AURORAOS_ENABLED
WARN_PRINT_ONCE("Force AuroraOS landscape mode enabled");
state.canvas_shader.set_conditional(CanvasShaderGLES2::USE_FORCE_LANDSCAPE, true);
#else
state.canvas_shader.set_conditional(CanvasShaderGLES2::USE_FORCE_LANDSCAPE, false);
Expand Down Expand Up @@ -124,7 +124,7 @@ void RasterizerCanvasBaseGLES2::canvas_begin() {
canvas_transform.scale(Vector3(2.0f / storage->frame.current_rt->width, csy * -2.0f / storage->frame.current_rt->height, 1.0f));
} else {
Vector2 ssize = OS::get_singleton()->get_window_size();
#if SAILFISH_FORCE_LANDSCAPE && SAILFISH_ENABLED
#if AURORAOS_FORCE_LANDSCAPE && AURORAOS_ENABLED
if (OS::get_singleton()->get_screen_orientation() == OS::SCREEN_LANDSCAPE ||
OS::get_singleton()->get_screen_orientation() == OS::SCREEN_SENSOR_LANDSCAPE ||
OS::get_singleton()->get_screen_orientation() == OS::SCREEN_REVERSE_LANDSCAPE)
Expand All @@ -143,7 +143,7 @@ void RasterizerCanvasBaseGLES2::canvas_begin() {

_set_uniforms();

#if SAILFISH_FORCE_LANDSCAPE && SAILFISH_ENABLED
#if AURORAOS_FORCE_LANDSCAPE && AURORAOS_ENABLED
// TODO: move this code to _set_uniforms
if (OS::get_singleton()->get_screen_orientation() == OS::SCREEN_LANDSCAPE)
state.canvas_shader.set_uniform(CanvasShaderGLES2::FORCE_LANDSCAPE, 1);
Expand All @@ -169,7 +169,7 @@ void RasterizerCanvasBaseGLES2::canvas_end() {
//reset viewport to full window size
int viewport_width = OS::get_singleton()->get_window_size().width;
int viewport_height = OS::get_singleton()->get_window_size().height;
#if SAILFISH_FORCE_LANDSCAPE && SAILFISH_ENABLED
#if AURORAOS_FORCE_LANDSCAPE && AURORAOS_ENABLED
if (OS::get_singleton()->get_screen_orientation() == OS::SCREEN_LANDSCAPE ||
OS::get_singleton()->get_screen_orientation() == OS::SCREEN_SENSOR_LANDSCAPE ||
OS::get_singleton()->get_screen_orientation() == OS::SCREEN_REVERSE_LANDSCAPE) {
Expand Down Expand Up @@ -295,7 +295,7 @@ void RasterizerCanvasBaseGLES2::draw_window_margins(int *black_margin, RID *blac
int window_h = window_size.height;
int window_w = window_size.width;

#if SAILFISH_FORCE_LANDSCAPE && SAILFISH_ENABLED
#if AURORAOS_FORCE_LANDSCAPE && AURORAOS_ENABLED
// force landscape
if (OS::get_singleton()->get_screen_orientation() == OS::SCREEN_LANDSCAPE ||
OS::get_singleton()->get_screen_orientation() == OS::SCREEN_SENSOR_LANDSCAPE ||
Expand All @@ -306,7 +306,7 @@ void RasterizerCanvasBaseGLES2::draw_window_margins(int *black_margin, RID *blac
#endif

glBindFramebuffer(GL_FRAMEBUFFER, storage->system_fbo);
#if SAILFISH_FORCE_LANDSCAPE && SAILFISH_ENABLED
#if AURORAOS_FORCE_LANDSCAPE && AURORAOS_ENABLED
glViewport(0, 0, window_w, window_h);
#else
glViewport(0, 0, window_size.width, window_size.height);
Expand Down
2 changes: 1 addition & 1 deletion drivers/gles2/rasterizer_canvas_gles2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,7 @@ void RasterizerCanvasGLES2::canvas_begin() {
}

void RasterizerCanvasGLES2::canvas_render_items_begin(const Color &p_modulate, Light *p_light, const Transform2D &p_base_transform) {
#if SAILFISH_FORCE_LANDSCAPE && SAILFISH_ENABLED
#if AURORAOS_FORCE_LANDSCAPE && AURORAOS_ENABLED
state.canvas_shader.set_uniform(CanvasShaderGLES2::FORCE_LANDSCAPE, 0);
#endif
batch_canvas_render_items_begin(p_modulate, p_light, p_base_transform);
Expand Down
4 changes: 2 additions & 2 deletions drivers/gles2/rasterizer_gles2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ void RasterizerGLES2::set_current_render_target(RID p_render_target) {
} else {
storage->frame.current_rt = nullptr;
storage->frame.clear_request = false;
#if SAILFISH_FORCE_LANDSCAPE && SAILFISH_ENABLED
#if AURORAOS_FORCE_LANDSCAPE && AURORAOS_ENABLED
if (OS::get_singleton()->get_screen_orientation() == OS::SCREEN_LANDSCAPE ||
OS::get_singleton()->get_screen_orientation() == OS::SCREEN_SENSOR_LANDSCAPE ||
OS::get_singleton()->get_screen_orientation() == OS::SCREEN_REVERSE_LANDSCAPE)
Expand Down Expand Up @@ -345,7 +345,7 @@ void RasterizerGLES2::set_boot_image(const Ref<Image> &p_image, const Color &p_c
return;
}

#if SAILFISH_FORCE_LANDSCAPE && SAILFISH_ENABLED
#if AURORAOS_FORCE_LANDSCAPE && AURORAOS_ENABLED
int window_w = OS::get_singleton()->get_window_size().width;
int window_h = OS::get_singleton()->get_window_size().height;

Expand Down
10 changes: 5 additions & 5 deletions drivers/gles2/rasterizer_storage_gles2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ GLuint RasterizerStorageGLES2::system_fbo = 0;
//void *glRenderbufferStorageMultisampleAPPLE;
//void *glResolveMultisampleFramebufferAPPLE;
#define glRenderbufferStorageMultisample glRenderbufferStorageMultisampleAPPLE
#elif defined(ANDROID_ENABLED) || defined(SAILFISH_ENABLED)
#elif defined(ANDROID_ENABLED) || defined(AURORAOS_ENABLED)

#include <GLES2/gl2ext.h>
PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC glRenderbufferStorageMultisampleEXT;
Expand Down Expand Up @@ -5148,7 +5148,7 @@ void RasterizerStorageGLES2::_render_target_allocate(RenderTarget *rt) {
glRenderbufferStorageMultisample(GL_RENDERBUFFER, msaa, color_internal_format, rt->width, rt->height);

glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, rt->multisample_color);
#elif defined(ANDROID_ENABLED) || defined(SAILFISH_ENABLED)
#elif defined(ANDROID_ENABLED) || defined(AURORAOS_ENABLED)
// Render to a texture in android
glGenTextures(1, &rt->multisample_color);
glBindTexture(GL_TEXTURE_2D, rt->multisample_color);
Expand Down Expand Up @@ -5176,7 +5176,7 @@ void RasterizerStorageGLES2::_render_target_allocate(RenderTarget *rt) {

glDeleteRenderbuffers(1, &rt->multisample_depth);
rt->multisample_depth = 0;
#if defined(ANDROID_ENABLED) || defined(SAILFISH_ENABLED)
#if defined(ANDROID_ENABLED) || defined(AURORAOS_ENABLED)
glDeleteTextures(1, &rt->multisample_color);
#else
glDeleteRenderbuffers(1, &rt->multisample_color);
Expand All @@ -5186,7 +5186,7 @@ void RasterizerStorageGLES2::_render_target_allocate(RenderTarget *rt) {

glBindRenderbuffer(GL_RENDERBUFFER, 0);
glBindFramebuffer(GL_FRAMEBUFFER, 0);
#if defined(ANDROID_ENABLED) || defined(SAILFISH_ENABLED)
#if defined(ANDROID_ENABLED) || defined(AURORAOS_ENABLED)
glBindTexture(GL_TEXTURE_2D, 0);
#endif

Expand Down Expand Up @@ -5423,7 +5423,7 @@ void RasterizerStorageGLES2::_render_target_clear(RenderTarget *rt) {

glDeleteRenderbuffers(1, &rt->multisample_depth);
rt->multisample_depth = 0;
#if defined(ANDROID_ENABLED) || defined(SAILFISH_ENABLED)
#if defined(ANDROID_ENABLED) || defined(AURORAOS_ENABLED)
glDeleteTextures(1, &rt->multisample_color);
#else
glDeleteRenderbuffers(1, &rt->multisample_color);
Expand Down
4 changes: 2 additions & 2 deletions drivers/gles2/shader_gles2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ ShaderGLES2::Version *ShaderGLES2::get_current_version() {
#else
strings.push_back("#version 100\n");

#ifdef SAILFISH_i486_GLES2
strings.push_back("#define USE_SAILFISH_i486_GLES2\n");
#ifdef AURORAOS_i486_GLES2
strings.push_back("#define USE_AURORAOS_i486_GLES2\n");
#endif

//angle does not like
Expand Down
2 changes: 1 addition & 1 deletion drivers/gles2/shaders/stdlib.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ highp mat4 inverse(highp mat4 m) {

#endif

#if defined(USE_SAILFISH_i486_GLES2)
#if defined(USE_AURORAOS_i486_GLES2)
#define TRANSPOSE_FUNC_NAME transpose_custom
#else
#define TRANSPOSE_FUNC_NAME transpose
Expand Down
6 changes: 3 additions & 3 deletions modules/webm/libvpx/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ if env["platform"] == "uwp":
elif env["platform"] != "windows": # Disable for Windows, yasm SIMD optimizations trigger crash (GH-50862).
import platform

is_x11_or_server_arm = (env["platform"] == "x11" or env["platform"] == "server" or env["platform"] == 'sailfish') and (
is_x11_or_server_arm = (env["platform"] == "x11" or env["platform"] == "server" or env["platform"] == 'auroraos') and (
platform.machine().startswith("arm") or platform.machine().startswith("aarch")
)
is_macos_x86 = env["platform"] == "osx" and ("arch" in env and (env["arch"] != "arm64"))
Expand All @@ -242,7 +242,7 @@ elif env["platform"] != "windows": # Disable for Windows, yasm SIMD optimizatio
env["platform"] == "windows"
or env["platform"] == "x11"
or env["platform"] == "haiku"
or env["platform"] == 'sailfish'
or env["platform"] == 'auroraos'
or is_macos_x86
or is_android_x86
or is_ios_x86
Expand Down Expand Up @@ -312,7 +312,7 @@ if webm_cpu_arm:
and env["android_arch"] == "armv7"
or env["platform"] == "x11"
or env["platform"] == "server"
or env["platform"] == 'sailfish'
or env["platform"] == 'auroraos'
):
env_libvpx["ASFLAGS"] = "-mfpu=neon"
elif env["platform"] == "uwp":
Expand Down
98 changes: 98 additions & 0 deletions platform/auroraos/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
## install AuroraSDK
1. Download and install [AuroraSDK](https://auroraosos.org/wiki/Application_SDK)
2. (optional) Install docker image, use [this instcruction](https://github.com/CODeRUS/docker-auroraosos-sdk-local) from @CODeRUS

## Add AuroraSDK/bin folder to PATH for using sfdk
```shell
export PATH=$HOME/AuroraSDK/bin:${PATH}
```
now you can use **sfdk** tool
```shell
sfdk engine exec <your command inside buildengine>
```
or, you can use absolute path to **sfdk**
```shell
~/AuroraOS/bin/sfdk engine exec echo "Hello from AuroraOS SDK build engine"
```

### Install dependencies in AuroraSDK targets
check list of targets
```shell
sfdk engine exec sb2-config -l
```

should output something like this

```shell
AuroraOS-4.3.0.12-aarch64.default
AuroraOS-4.3.0.12-aarch64
AuroraOS-4.3.0.12-armv7hl.default
AuroraOS-4.3.0.12-armv7hl
AuroraOS-4.3.0.12-i486.default
AuroraOS-4.3.0.12-i486
```

**armv7hl**
```sh
sfdk engine exec sb2 -t AuroraOS-4.3.0.12-armv7hl -R zypper in -y SDL2-devel systemd-devel libaudioresource-devel pulseaudio-devel openssl-devel libwebp-devel libvpx-devel wayland-devel libpng-devel scons
```

**i486**
```sh
sfdk engine exec sb2 -t AuroraOS-4.3.0.12-i486 -R zypper in -y SDL2-devel systemd-devel libaudioresource-devel pulseaudio-devel openssl-devel libwebp-devel libvpx-devel wayland-devel libpng-devel scons
```

**aarch64**
```sh
sfdk engine exec sb2 -t AuroraOS-4.3.0.12-aarch64 -R zypper in -y SDL2-devel systemd-devel libaudioresource-devel pulseaudio-devel openssl-devel libwebp-devel libvpx-devel wayland-devel libpng-devel scons
```

or by **one line** script for all targets in same time ;) :
```shell
for each in `sfdk engine exec sb2-config -l|grep -v default`; do sfdk engine exec sb2 -t $each -R zypper in -y SDL2-devel libaudioresource-devel pulseaudio-devel openssl-devel libwebp-devel libvpx-devel wayland-devel libpng-devel systemd-devel scons; done
```

## Build Godot export template for AuroraOS OS
Use sfdk from AuroraSDK/bin/sfdk

```sh
export PATH=$HOME/AuroraSDK/bin:${PATH}
# building for armv7hl platfrom
sfdk engine exec sb2 -t AuroraOS-4.3.0.12-armv7hl scons -j`nproc` arch=arm platform=auroraos tools=no bits=32 target=release
# than do same for aarch64 platfrom
sfdk engine exec sb2 -t AuroraOS-4.3.0.12-aarch64 scons -j`nproc` arch=arm64 platform=auroraos tools=no bits=64 target=release
# than do same for i486 platfrom
sfdk engine exec sb2 -t AuroraOS-4.3.0.12-i486 scons -j`nproc` arch=x86 platform=auroraos tools=no bits=32 target=release
# then make export tempalte smaller
sfdk engine exec sb2 -t AuroraOS-4.3.0.12-arm7hl strip bin/godot.auroraos.opt.arm
sfdk engine exec sb2 -t AuroraOS-4.3.0.12-aarch64 strip bin/godot.auroraos.opt.arm64
sfdk engine exec sb2 -t AuroraOS-4.3.0.12-i486 strip bin/godot.auroraos.opt.x86
```

## Build Godot Editor with AuroraOS export menu
### build on Linux X11
```shell
scons -j`nproc` arch=x64 platform=x11 tools=yes bits=64 traget=release_debug
strip bin/godot.x11.tools.x64
```
### build for Win64 with cross compile toolkit on Linux
First, install cross compile gcc
#### on ubuntu
```
sudo apt install -y mingw-w64
```
then choose posix compiler, with commands below
```
sudo update-alternatives --config x86_64-w64-mingw32-gcc
sudo update-alternatives --config x86_64-w64-mingw32-g++
```
#### on fedora (centos)
```
sudo dnf install -y mingw64-gcc-c++ mingw64-gcc
```
#### build an editor
```shell
#ubuntu
CXX=x86_64-w64-mingw32-g++ CC=x86_64-w64-mingw32-gcc scons -j`nproc` arch=x64 platform=windows tools=yes bits=64 traget=release_debug
x86_64-w64-mingw32-strip bin/godot.windows.tools.x64.exe
```
File renamed without changes.
Loading

0 comments on commit 2b6ec2b

Please sign in to comment.