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;
};
No comments:
Post a Comment