Hello,

godot was updated again recently and the 3.5 release in particular in
quite featureful, both for the additions to the engine and for the
players.  stuff like the "ubershader" is quite interesting.

However, this release also requires a freetype built with Brotli
support, so i had to resort to building it with the bundled freetype.

I also had to tweak the joypad code.  The changes were inspired by
similar changes in the linux code, but as i don't own a ujoy(4)
compatible controller I couldn't test the state.  (+cc thfr)

The godotsteam custom module also should be updated.  We're still
using the GodotSteam code for 3.4.0, and while it works it should
probably be updated to a newer release.  unfortunately GodotSteam
g35-s155-gs3171 doesn't compile, it probably needs an updated goldberg
emulator?  I haven't looked into it really, this can be solved later I
guess.

So, here's the diff for the update, I inted to commit it in a couple
of days unless I hear objections.  Tests and oks welcome! :)

Cheers,

Omar Polo

Index: Makefile
===================================================================
RCS file: /home/cvs/ports/games/godot/Makefile,v
retrieving revision 1.38
diff -u -p -r1.38 Makefile
--- Makefile    5 Aug 2022 14:19:42 -0000       1.38
+++ Makefile    6 Aug 2022 15:37:21 -0000
@@ -3,8 +3,9 @@ BROKEN-powerpc =        fails at runtime, the U
 COMMENT-main = 2D and 3D game engine
 COMMENT-tools= 2D and 3D game engine (with tools)
 
-V =            3.4.5
+V =            3.5
 GODOTSTEAM_V = g34-s152-gs311
+#GODOTSTEAM_V =        g35-s155-gs3171
 DISTNAME =     godot-${V}-stable
 PKGNAME =      godot-${V}
 
@@ -22,10 +23,10 @@ MULTI_PACKAGES =    -main -tools
 WANTLIB += ${COMPILER_LIBCXX} BulletCollision BulletDynamics BulletSoftBody
 WANTLIB += GL LinearMath X11 X11-xcb Xau Xcursor Xdmcp Xext Xfixes
 WANTLIB += Xi Xinerama Xrandr Xrender Xxf86vm c drm enet execinfo
-WANTLIB += freetype intl m mbedcrypto mbedtls mbedx509 mpcdec
-WANTLIB += ogg opus opusfile pcre2-32 png sndio steam_api theora
-WANTLIB += theoradec usbhid vorbis vorbisfile vpx webp xcb xcb-dri2
-WANTLIB += xcb-glx z zstd
+WANTLIB += intl m mbedcrypto mbedtls mbedx509 mpcdec ogg opus
+WANTLIB += opusfile pcre2-32 sndio steam_api theora theoradec
+WANTLIB += usbhid vorbis vorbisfile vpx webp xcb xcb-dri2 xcb-glx
+WANTLIB += zstd
 
 WANTLIB-tools = ${WANTLIB}
 
@@ -50,7 +51,6 @@ MODSCONS_FLAGS =      CC="${CC}" \
                        LINKFLAGS="${LDFLAGS} -lintl -lmpcdec -lusbhid" \
                        builtin_bullet=no \
                        builtin_enet=no \
-                       builtin_freetype=no \
                        builtin_glew=no \
                        builtin_libmpcdec=no \
                        builtin_libogg=no \
@@ -71,6 +71,9 @@ MODSCONS_FLAGS =      CC="${CC}" \
                        warnings=extra \
                        werror=no
 
+# requires freetype with Brotli support
+MODSCONS_FLAGS += builtin_freetype=yes
+
 # The raycast module requires embree which is enabled on all 64bit
 # arches but actually supports only amd64.
 .if ! ${MACHINE_ARCH:Mamd64}
@@ -86,7 +89,6 @@ LIB_DEPENDS =         archivers/zstd \
                        devel/pcre2 \
                        games/goldberg_emulator \
                        graphics/libwebp \
-                       graphics/png \
                        multimedia/libtheora \
                        multimedia/libvpx \
                        net/enet \
Index: distinfo
===================================================================
RCS file: /home/cvs/ports/games/godot/distinfo,v
retrieving revision 1.15
diff -u -p -r1.15 distinfo
--- distinfo    5 Aug 2022 14:19:42 -0000       1.15
+++ distinfo    6 Aug 2022 10:14:11 -0000
@@ -1,4 +1,4 @@
-SHA256 (godot-3.4.5/g34-s152-gs311.tar.gz) = 
hjoW9t+RN6JTjWn2RhEZ2H7EljJ5tV5ybU4JwK/6wpc=
-SHA256 (godot-3.4.5/godot-3.4.5-stable.tar.xz) = 
GFfMsNSEchFmS5RMj+rtGDLJhFoPHlqohhNt5mEQo4g=
-SIZE (godot-3.4.5/g34-s152-gs311.tar.gz) = 197461
-SIZE (godot-3.4.5/godot-3.4.5-stable.tar.xz) = 22630816
+SHA256 (godot-3.5/g34-s152-gs311.tar.gz) = 
hjoW9t+RN6JTjWn2RhEZ2H7EljJ5tV5ybU4JwK/6wpc=
+SHA256 (godot-3.5/godot-3.5-stable.tar.xz) = 
IqRwZTkriioZaQ20IIWydWwvZ5lr0kaIyxcwf4pLWcg=
+SIZE (godot-3.5/g34-s152-gs311.tar.gz) = 197461
+SIZE (godot-3.5/godot-3.5-stable.tar.xz) = 24044340
Index: files/ujoy/joypad_openbsd.cpp
===================================================================
RCS file: /home/cvs/ports/games/godot/files/ujoy/joypad_openbsd.cpp,v
retrieving revision 1.1
diff -u -p -r1.1 joypad_openbsd.cpp
--- files/ujoy/joypad_openbsd.cpp       15 Apr 2022 20:23:19 -0000      1.1
+++ files/ujoy/joypad_openbsd.cpp       4 Aug 2022 07:15:01 -0000
@@ -193,9 +193,10 @@ void JoypadOpenBSD::Joypad::reset() {
        dpad = 0;
        fd = -1;
 
-       InputDefault::JoyAxis jx;
-       jx.min = -1;
-       jx.value = 0.0f;
+       for (int i = 0; i < MAX_ABS; ++i) {
+               abs_map[i] = -1;
+               curr_axis[i] = 0;
+       }
 }
 
 JoypadOpenBSD::JoypadOpenBSD(InputDefault *in) {
@@ -370,21 +371,9 @@ void JoypadOpenBSD::joypad_vibration_sto
        /* not supported */
 }
 
-InputDefault::JoyAxis JoypadOpenBSD::axis_correct(int min, int max, int 
p_value) const {
-        InputDefault::JoyAxis jx;
-
-        if (min < 0) {
-                jx.min = -1;
-                if (p_value < 0) {
-                        jx.value = (float)-p_value / min;
-                } else {
-                        jx.value = (float)p_value / max;
-                }
-        } else if (min == 0) {
-                jx.min = 0;
-                jx.value = 0.0f + (float)p_value / max;
-        }
-        return jx;
+float JoypadOpenBSD::axis_correct(int min, int max, int p_value) const {
+       // Convert to a value between -1.0 and 1.0f.
+       return 2.0f * (p_value - min) / (max - min) - 1.0f;
 }
 
 void JoypadOpenBSD::process_joypads() {
@@ -417,6 +406,7 @@ void JoypadOpenBSD::process_joypads() {
                        }
 
                        for (nbutton = 0; hid_get_item(hdata, &hitem) > 0;) {
+                               (void)nbutton;
                                switch (hitem.kind) {
                                case hid_input:
                                        unsigned usage;
@@ -427,6 +417,7 @@ void JoypadOpenBSD::process_joypads() {
                                                joyaxe = usage_to_joyaxe(usage);
                                                if (joyaxe >= 0) {
                                                        naxe = 
joy->axis_map[joyaxe];
+                                                       (void)naxe;
                                                        v = 
hid_get_data(REP_BUF_DATA(rep), &hitem);
                                                        /* XInput 
controllermapping relies on inverted Y axes.
                                                         * These devices have a 
16bit signed space, as opposed
Index: files/ujoy/joypad_openbsd.h
===================================================================
RCS file: /home/cvs/ports/games/godot/files/ujoy/joypad_openbsd.h,v
retrieving revision 1.1
diff -u -p -r1.1 joypad_openbsd.h
--- files/ujoy/joypad_openbsd.h 15 Apr 2022 20:23:19 -0000      1.1
+++ files/ujoy/joypad_openbsd.h 4 Aug 2022 07:15:01 -0000
@@ -66,7 +66,7 @@ private:
        };
 
        struct Joypad {
-               InputDefault::JoyAxis curr_axis[MAX_ABS];
+               float curr_axis[MAX_ABS];
                int key_map[MAX_KEY];
                int abs_map[MAX_ABS];
                int dpad;
@@ -114,7 +114,7 @@ private:
        void joypad_vibration_start(int p_id, float p_weak_magnitude, float 
p_strong_magnitude, float p_duration, uint64_t p_timestamp);
        void joypad_vibration_stop(int p_id, uint64_t p_timestamp);
 
-       InputDefault::JoyAxis axis_correct(int min, int max, int p_value) const;
+       float axis_correct(int min, int max, int p_value) const;
 };
 
 #endif
Index: patches/patch-drivers_unix_os_unix_cpp
===================================================================
RCS file: /home/cvs/ports/games/godot/patches/patch-drivers_unix_os_unix_cpp,v
retrieving revision 1.10
diff -u -p -r1.10 patch-drivers_unix_os_unix_cpp
--- patches/patch-drivers_unix_os_unix_cpp      5 Aug 2022 14:19:42 -0000       
1.10
+++ patches/patch-drivers_unix_os_unix_cpp      6 Aug 2022 07:29:07 -0000
@@ -4,7 +4,7 @@ https://github.com/godotengine/godot/pul
 Index: drivers/unix/os_unix.cpp
 --- drivers/unix/os_unix.cpp.orig
 +++ drivers/unix/os_unix.cpp
-@@ -482,12 +482,6 @@ String OS_Unix::get_executable_path() const {
+@@ -491,12 +491,6 @@ String OS_Unix::get_executable_path() const {
                return OS::get_executable_path();
        }
        return b;
@@ -17,7 +17,7 @@ Index: drivers/unix/os_unix.cpp
  #elif defined(__FreeBSD__)
        int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 };
        char buf[MAXPATHLEN];
-@@ -514,7 +508,6 @@ String OS_Unix::get_executable_path() const {
+@@ -523,7 +517,6 @@ String OS_Unix::get_executable_path() const {
  
        return path;
  #else
Index: patches/patch-misc_dist_linux_org_godotengine_Godot_desktop
===================================================================
RCS file: 
/home/cvs/ports/games/godot/patches/patch-misc_dist_linux_org_godotengine_Godot_desktop,v
retrieving revision 1.1
diff -u -p -r1.1 patch-misc_dist_linux_org_godotengine_Godot_desktop
--- patches/patch-misc_dist_linux_org_godotengine_Godot_desktop 28 Apr 2022 
22:18:01 -0000      1.1
+++ patches/patch-misc_dist_linux_org_godotengine_Godot_desktop 6 Aug 2022 
07:29:07 -0000
@@ -1,10 +1,10 @@
 Index: misc/dist/linux/org.godotengine.Godot.desktop
 --- misc/dist/linux/org.godotengine.Godot.desktop.orig
 +++ misc/dist/linux/org.godotengine.Godot.desktop
-@@ -2,7 +2,7 @@
- Name=Godot Engine
- GenericName=Libre game engine
- Comment=Multi-platform 2D and 3D game engine with a feature-rich editor
+@@ -8,7 +8,7 @@ Comment=Multi-platform 2D and 3D game engine with a fe
+ Comment[el]=2D και 3D μηχανή παιχνιδιού πολλαπλών πλατφορμών με επεξεργαστή 
πλούσιο σε χαρακτηριστικά
+ Comment[fr]=Moteur de jeu 2D et 3D multiplateforme avec un éditeur riche en 
fonctionnalités
+ Comment[zh_CN]=多平台 2D 和 3D 游戏引擎,带有功能丰富的编辑器
 -Exec=godot %f
 +Exec=${TRUEPREFIX}/bin/godot-tools %f
  Icon=godot
Index: patches/patch-platform_x11_detect_py
===================================================================
RCS file: /home/cvs/ports/games/godot/patches/patch-platform_x11_detect_py,v
retrieving revision 1.11
diff -u -p -r1.11 patch-platform_x11_detect_py
--- patches/patch-platform_x11_detect_py        5 Aug 2022 14:19:42 -0000       
1.11
+++ patches/patch-platform_x11_detect_py        6 Aug 2022 07:29:07 -0000
@@ -6,7 +6,7 @@
 Index: platform/x11/detect.py
 --- platform/x11/detect.py.orig
 +++ platform/x11/detect.py
-@@ -89,29 +89,6 @@ def get_flags():
+@@ -90,29 +90,6 @@ def get_flags():
  def configure(env):
      ## Build type
  
@@ -36,7 +36,7 @@ Index: platform/x11/detect.py
      ## Architecture
  
      is64 = sys.maxsize > 2**32
-@@ -332,6 +309,10 @@ def configure(env):
+@@ -363,6 +340,10 @@ def configure(env):
      else:
          print("Warning: ALSA libraries not found. Disabling the ALSA audio 
driver.")
  
@@ -47,7 +47,7 @@ Index: platform/x11/detect.py
      if env["pulseaudio"]:
          if os.system("pkg-config --exists libpulse") == 0:  # 0 means found
              env.Append(CPPDEFINES=["PULSEAUDIO_ENABLED"])
-@@ -350,6 +331,9 @@ def configure(env):
+@@ -381,6 +362,9 @@ def configure(env):
      else:
          env["udev"] = False  # Linux specific
  
@@ -57,7 +57,7 @@ Index: platform/x11/detect.py
      # Linkflags below this line should typically stay the last ones
      if not env["builtin_zlib"]:
          env.ParseConfig("pkg-config zlib --cflags --libs")
-@@ -380,11 +364,6 @@ def configure(env):
+@@ -411,11 +395,6 @@ def configure(env):
              print(
                  "Warning: Creating template binaries enabled for PCK 
embedding is currently only supported with GNU ld, not gold or LLD."
              )
Index: patches/patch-platform_x11_os_x11_cpp
===================================================================
RCS file: /home/cvs/ports/games/godot/patches/patch-platform_x11_os_x11_cpp,v
retrieving revision 1.11
diff -u -p -r1.11 patch-platform_x11_os_x11_cpp
--- patches/patch-platform_x11_os_x11_cpp       5 Aug 2022 14:19:42 -0000       
1.11
+++ patches/patch-platform_x11_os_x11_cpp       6 Aug 2022 07:29:07 -0000
@@ -4,7 +4,7 @@ use OpenBSD joypad class
 Index: platform/x11/os_x11.cpp
 --- platform/x11/os_x11.cpp.orig
 +++ platform/x11/os_x11.cpp
-@@ -157,7 +157,7 @@ Error OS_X11::initialize(const VideoMode &p_desired, i
+@@ -173,7 +173,7 @@ Error OS_X11::initialize(const VideoMode &p_desired, i
        int xrandr_minor = 0;
        int event_base, error_base;
        xrandr_ext_ok = XRRQueryExtension(x11_display, &event_base, 
&error_base);
@@ -13,7 +13,7 @@ Index: platform/x11/os_x11.cpp
        if (!xrandr_handle) {
                err = dlerror();
                // For some arcane reason, NetBSD now ships libXrandr.so.3 
while the rest of the world has libXrandr.so.2...
-@@ -594,7 +594,7 @@ Error OS_X11::initialize(const VideoMode &p_desired, i
+@@ -610,7 +610,7 @@ Error OS_X11::initialize(const VideoMode &p_desired, i
  
        window_has_focus = true; // Set focus to true at init
  #ifdef JOYDEV_ENABLED
@@ -22,7 +22,7 @@ Index: platform/x11/os_x11.cpp
  #endif
  
        power_manager = memnew(PowerX11);
-@@ -4110,6 +4110,11 @@ void OS_X11::update_real_mouse_position() {
+@@ -4414,6 +4414,11 @@ void OS_X11::update_real_mouse_position() {
  }
  
  OS_X11::OS_X11() {
Index: patches/patch-platform_x11_os_x11_h
===================================================================
RCS file: /home/cvs/ports/games/godot/patches/patch-platform_x11_os_x11_h,v
retrieving revision 1.5
diff -u -p -r1.5 patch-platform_x11_os_x11_h
--- patches/patch-platform_x11_os_x11_h 15 Apr 2022 20:23:19 -0000      1.5
+++ patches/patch-platform_x11_os_x11_h 6 Aug 2022 07:29:07 -0000
@@ -16,7 +16,7 @@ Index: platform/x11/os_x11.h
  #include "main/input_default.h"
  #include "power_x11.h"
  #include "servers/audio_server.h"
-@@ -197,7 +198,7 @@ class OS_X11 : public OS_Unix {
+@@ -199,7 +200,7 @@ class OS_X11 : public OS_Unix {
        InputDefault *input;
  
  #ifdef JOYDEV_ENABLED
@@ -25,7 +25,7 @@ Index: platform/x11/os_x11.h
  #endif
  
  #ifdef ALSA_ENABLED
-@@ -206,6 +207,10 @@ class OS_X11 : public OS_Unix {
+@@ -208,6 +209,10 @@ class OS_X11 : public OS_Unix {
  
  #ifdef ALSAMIDI_ENABLED
        MIDIDriverALSAMidi driver_alsamidi;

Reply via email to