On Fri Sep 04, 2020 at 03:57:49PM -0600, Thomas Frohwein wrote:
> Hi,
> 
> This is an update for fs2open to 19.0.0 which was released in January.
> I'm planning to get this update in before ports tree locks. As it's a
> non-trivial one, some additional eyes and input would be appreciated.

Just a quick gameplay test:

- fullscreen ok
- sound ok
- keyboard and mouse gameplay ok

$ dmesg|grep intel
inteldrm0 at pci0 dev 2 function 0 "Intel HD Graphics 530" rev 0x06
drm0 at inteldrm0
inteldrm0: msi, SKYLAKE, gen 9
inteldrm0: 2560x1440, 32bpp
wsdisplay0 at inteldrm0 mux 1: console (std, vt100 emulation), using wskbd0

Form the runtime perspective ok

Rafael

> 
> Notes:
> - Changelog: 
> https://github.com/scp-fs2open/fs2open.github.com/releases/tag/release_19_0_0
> - disables bundles SDL2 which is running behind (2.0.10 vs 2.0.12)
> - tested on both radeon (earlier draft) and intel Coffeelake. I noticed
>   that with radeon (Radeon HD 6870), I was unable to get the first
>   mission in nebula to load. It's called Mystery of the Trinity (Act 1,
>   Mission 5) and analysis of the coredump implicates
>   code/graphics/opengl/gropenglshader.cpp:790. No such issue with
>   intel. Likely an issue with shader support on Radeon.
> - had to rename a variable _L -> _LuaState to avoid clash with a macro
>   in ctype.h
> - Expanded the README because fullscreen tends to have issues with
>   scaling correctly. This issue was already present in prior versions.
> - all other changes are generally trivial
> 
> oks? comments?
> 
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/games/fs2open/Makefile,v
> retrieving revision 1.8
> diff -u -p -r1.8 Makefile
> --- Makefile  20 Aug 2020 17:32:37 -0000      1.8
> +++ Makefile  4 Sep 2020 21:42:54 -0000
> @@ -1,11 +1,10 @@
> -# $OpenBSD: Makefile,v 1.8 2020/08/20 17:32:37 thfr Exp $
> +# $OpenBSD: Makefile,v 1.7 2019/07/14 02:16:51 naddy Exp $
>  
>  COMMENT =    open source game engine based on FreeSpace 2
>  
> -V =          3.8.0
> +V =          19.0.0
>  DISTNAME =   fs2_open_${V:S/./_/g}-source-Unix
>  PKGNAME =    fs2open-${V}
> -REVISION =   3
>  
>  CATEGORIES = games
>  
> @@ -19,14 +18,11 @@ PERMIT_DISTFILES =        no license at all
>  
>  WANTLIB += ${COMPILER_LIBCXX} c m z
>  WANTLIB += SDL2 ${MODLUA_WANTLIB} openal
> -WANTLIB += avcodec avformat avutil jpeg swresample swscale
> +WANTLIB += avcodec avformat avutil freetype jpeg swresample swscale
>  WANTLIB += jansson png
>  
>  MASTER_SITES =       
> https://github.com/scp-fs2open/fs2open.github.com/releases/download/release_${V:S/./_/g}/
>  
> -# Remove on next update
> -DISTFILES = ${DISTNAME}_1{${DISTNAME}}${EXTRACT_SUFX}
> -
>  # c++11
>  COMPILER =           base-clang ports-gcc
>  MODULES =            devel/cmake \
> @@ -40,12 +36,20 @@ LIB_DEPENDS =             audio/openal \
>  CONFIGURE_ARGS =     -DCMAKE_INSTALL_PREFIX=${LOCALBASE}/share/fs2open \
>                       -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen:Bool=Yes
>  
> +# currently not building; would be ${WRKBUILD}/bin/unittests
>  NO_TEST =            Yes
>  
>  WRKDIST =            ${WRKDIR}/fs2open.github.com
>  
> +# remove bundled SDL
> +post-extract:
> +     rm -rf ${WRKSRC}/lib/libsdl
> +
>  pre-patch:
>       @cd ${WRKSRC} && perl -i -pe 's/\r$$//' 
> code/utils/boost/syncboundedqueue.h
> +
> +do-gen:
> +     ${SUBST_CMD} ${WRKSRC}/CMakeLists.txt
>  
>  post-install:
>       ${SUBST_CMD} -c -m 755 ${FILESDIR}/fs2open ${PREFIX}/bin/fs2open
> Index: distinfo
> ===================================================================
> RCS file: /cvs/ports/games/fs2open/distinfo,v
> retrieving revision 1.3
> diff -u -p -r1.3 distinfo
> --- distinfo  2 Mar 2018 06:59:06 -0000       1.3
> +++ distinfo  4 Sep 2020 21:42:54 -0000
> @@ -1,2 +1,2 @@
> -SHA256 (fs2_open_3_8_0-source-Unix_1.tar.gz) = 
> 0m/4tma9rh6fQquvL0mNs2EJPyKJ2nhVXx9vu6dWIic=
> -SIZE (fs2_open_3_8_0-source-Unix_1.tar.gz) = 9040907
> +SHA256 (fs2_open_19_0_0-source-Unix.tar.gz) = 
> lRzBrQo8iZ3VNRXrGpfDxxndhL3b3QHdkXeIT5klYo4=
> +SIZE (fs2_open_19_0_0-source-Unix.tar.gz) = 12195030
> Index: patches/patch-CMakeLists_txt
> ===================================================================
> RCS file: /cvs/ports/games/fs2open/patches/patch-CMakeLists_txt,v
> retrieving revision 1.1.1.1
> diff -u -p -r1.1.1.1 patch-CMakeLists_txt
> --- patches/patch-CMakeLists_txt      16 Feb 2018 11:39:51 -0000      1.1.1.1
> +++ patches/patch-CMakeLists_txt      4 Sep 2020 21:42:54 -0000
> @@ -1,13 +1,23 @@
>  $OpenBSD: patch-CMakeLists_txt,v 1.1.1.1 2018/02/16 11:39:51 kirby Exp $
>  
> +add include and lib directories to find system SDL2
>  try to avoid get_target_property error
> -remove cotire submodule dependency
>  
>  Index: CMakeLists.txt
>  --- CMakeLists.txt.orig
>  +++ CMakeLists.txt
> -@@ -13,6 +13,7 @@ include(cmake/util.cmake)
> - set_policy(CMP0051 OLD)
> +@@ -2,6 +2,9 @@
> + CMAKE_MINIMUM_REQUIRED(VERSION 3.4)
> + set_property(GLOBAL PROPERTY USE_FOLDERS ON)
> + 
> ++include_directories( "${LOCALBASE}/include" "${LOCALBASE}/include/SDL2" )
> ++link_directories( "${LOCALBASE}/lib" )
> ++
> + # Make sure the source and binary directory are not the sample
> + if ("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
> +     message(FATAL_ERROR "Binary and source directory can not be the same! 
> Choose another build directory.")
> +@@ -13,6 +16,7 @@ include(cmake/util.cmake)
> + set_policy(CMP0051 NEW)
>   set_policy(CMP0053 NEW)
>   set_policy(CMP0054 NEW)
>  +set_policy(CMP0026 OLD)     # to avoid get_target_property error
> Index: patches/patch-cmake_platformChecks_cmake
> ===================================================================
> RCS file: /cvs/ports/games/fs2open/patches/patch-cmake_platformChecks_cmake,v
> retrieving revision 1.1
> diff -u -p -r1.1 patch-cmake_platformChecks_cmake
> --- patches/patch-cmake_platformChecks_cmake  29 May 2018 07:32:31 -0000      
> 1.1
> +++ patches/patch-cmake_platformChecks_cmake  4 Sep 2020 21:42:54 -0000
> @@ -1,4 +1,4 @@
> -$OpenBSD: patch-cmake_platformChecks_cmake,v 1.1 2018/05/29 07:32:31 kirby 
> Exp $
> +$OpenBSD$
>  
>  Index: cmake/platformChecks.cmake
>  --- cmake/platformChecks.cmake.orig
> @@ -7,8 +7,8 @@ Index: cmake/platformChecks.cmake
>   include(CheckCXXSymbolExists)
>   include(CheckTypeSize)
>   
> --CHECK_INCLUDE_FILE("execinfo.h" HAVE_EXECINFO_H)
> -+#CHECK_INCLUDE_FILE("execinfo.h" HAVE_EXECINFO_H)
> - CHECK_INCLUDE_FILE_CXX("cxxabi.h" HAVE_CXXAPI_H)
> +-CHECK_INCLUDE_FILE("execinfo.h" SCP_HAVE_EXECINFO_H)
> ++#CHECK_INCLUDE_FILE("execinfo.h" SCP_HAVE_EXECINFO_H)
> + CHECK_INCLUDE_FILE_CXX("cxxabi.h" SCP_HAVE_CXXAPI_H)
>   
>   CHECK_TYPE_SIZE("max_align_t" MAX_ALIGN_T)
> Index: patches/patch-cmake_toolchain-clang_cmake
> ===================================================================
> RCS file: /cvs/ports/games/fs2open/patches/patch-cmake_toolchain-clang_cmake,v
> retrieving revision 1.1.1.1
> diff -u -p -r1.1.1.1 patch-cmake_toolchain-clang_cmake
> --- patches/patch-cmake_toolchain-clang_cmake 16 Feb 2018 11:39:51 -0000      
> 1.1.1.1
> +++ patches/patch-cmake_toolchain-clang_cmake 4 Sep 2020 21:42:54 -0000
> @@ -1,16 +1,19 @@
> -$OpenBSD: patch-cmake_toolchain-clang_cmake,v 1.1.1.1 2018/02/16 11:39:51 
> kirby Exp $
> +$OpenBSD$
>  
> -remove hardcoded -O2
> +remove hardcoded -O{0,2} flags
>  
>  Index: cmake/toolchain-clang.cmake
>  --- cmake/toolchain-clang.cmake.orig
>  +++ cmake/toolchain-clang.cmake
> -@@ -80,7 +80,7 @@ if(SUPPORTS_SHIFT_NEGATIVE_VALUE)
> +@@ -82,9 +82,9 @@ if(SUPPORTS_SHIFT_NEGATIVE_VALUE)
>       set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wno-shift-negative-value")
>   endif()
>   
> --set(COMPILER_FLAGS_RELEASE "-O2 -Wno-unused-variable")
> -+set(COMPILER_FLAGS_RELEASE "-Wno-unused-variable")
> +-set(COMPILER_FLAGS_RELEASE "-O2 -Wno-unused-variable -Wno-unused-parameter")
> ++set(COMPILER_FLAGS_RELEASE "-Wno-unused-variable -Wno-unused-parameter")
>   
> - set(COMPILER_FLAGS_DEBUG "-O0 -g -Wshadow")
> +-set(COMPILER_FLAGS_DEBUG "-O0 -g -Wshadow")
> ++set(COMPILER_FLAGS_DEBUG "-g -Wshadow")
>   
> + # Always use the base flags and add our compiler flags at the bacl
> + set(CMAKE_CXX_FLAGS "${CXX_BASE_FLAGS} ${COMPILER_FLAGS}")
> Index: patches/patch-cmake_toolchain-gcc_cmake
> ===================================================================
> RCS file: /cvs/ports/games/fs2open/patches/patch-cmake_toolchain-gcc_cmake,v
> retrieving revision 1.1.1.1
> diff -u -p -r1.1.1.1 patch-cmake_toolchain-gcc_cmake
> --- patches/patch-cmake_toolchain-gcc_cmake   16 Feb 2018 11:39:51 -0000      
> 1.1.1.1
> +++ patches/patch-cmake_toolchain-gcc_cmake   4 Sep 2020 21:42:54 -0000
> @@ -1,16 +1,19 @@
> -$OpenBSD: patch-cmake_toolchain-gcc_cmake,v 1.1.1.1 2018/02/16 11:39:51 
> kirby Exp $
> +$OpenBSD$
>  
> -remove hardcoded -O2
> +remove hardcoded -O{0,2} flags
>  
>  Index: cmake/toolchain-gcc.cmake
>  --- cmake/toolchain-gcc.cmake.orig
>  +++ cmake/toolchain-gcc.cmake
> -@@ -87,7 +87,7 @@ set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wno-deprecated 
> +@@ -94,9 +94,9 @@ if(SUPPORTS_STRINGOP_TRUNCATION)
> +     set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wno-stringop-overflow")
> + endif()
>   
> - set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wno-unused-parameter")
> +-set(COMPILER_FLAGS_RELEASE "-O2 -Wno-unused-variable 
> -Wno-unused-but-set-variable -Wno-array-bounds -Wno-empty-body -Wno-clobbered 
>  -Wno-unused-parameter")
> ++set(COMPILER_FLAGS_RELEASE "-Wno-unused-variable 
> -Wno-unused-but-set-variable -Wno-array-bounds -Wno-empty-body -Wno-clobbered 
>  -Wno-unused-parameter")
>   
> --set(COMPILER_FLAGS_RELEASE "-O2 -Wno-unused-variable 
> -Wno-unused-but-set-variable -Wno-array-bounds -Wno-empty-body 
> -Wno-clobbered")
> -+set(COMPILER_FLAGS_RELEASE "-Wno-unused-variable 
> -Wno-unused-but-set-variable -Wno-array-bounds -Wno-empty-body 
> -Wno-clobbered")
> - 
> - set(COMPILER_FLAGS_DEBUG "-O0 -g -Wshadow")
> +-set(COMPILER_FLAGS_DEBUG "-O0 -g -Wshadow")
> ++set(COMPILER_FLAGS_DEBUG "-g -Wshadow")
>   
> + # Always use the base flags and add our compiler flags at the bacl
> + set(CMAKE_CXX_FLAGS "${CXX_BASE_FLAGS} ${COMPILER_FLAGS}")
> Index: patches/patch-code_CMakeLists_txt
> ===================================================================
> RCS file: patches/patch-code_CMakeLists_txt
> diff -N patches/patch-code_CMakeLists_txt
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-code_CMakeLists_txt 4 Sep 2020 21:42:54 -0000
> @@ -0,0 +1,16 @@
> +$OpenBSD$
> +
> +correct capitalization for libSDL2
> +
> +Index: code/CMakeLists.txt
> +--- code/CMakeLists.txt.orig
> ++++ code/CMakeLists.txt
> +@@ -26,7 +26,7 @@ TARGET_LINK_LIBRARIES(code PUBLIC ${LUA_LIBS})
> + TARGET_LINK_LIBRARIES(code PUBLIC ${PNG_LIBS})
> + TARGET_LINK_LIBRARIES(code PUBLIC ${JPEG_LIBS})
> + 
> +-TARGET_LINK_LIBRARIES(code PUBLIC sdl2)
> ++TARGET_LINK_LIBRARIES(code PUBLIC SDL2)
> + 
> + TARGET_LINK_LIBRARIES(code PUBLIC ffmpeg)
> + 
> Index: patches/patch-code_libs_renderdoc_renderdoc_app_h
> ===================================================================
> RCS file: patches/patch-code_libs_renderdoc_renderdoc_app_h
> diff -N patches/patch-code_libs_renderdoc_renderdoc_app_h
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-code_libs_renderdoc_renderdoc_app_h 4 Sep 2020 21:42:54 
> -0000
> @@ -0,0 +1,16 @@
> +$OpenBSD$
> +
> +add to ifdef
> +
> +Index: code/libs/renderdoc/renderdoc_app.h
> +--- code/libs/renderdoc/renderdoc_app.h.orig
> ++++ code/libs/renderdoc/renderdoc_app.h
> +@@ -35,7 +35,7 @@
> + 
> + #if defined(WIN32)
> + #define RENDERDOC_CC __cdecl
> +-#elif defined(__linux__)
> ++#elif defined(__linux__) || defined(__OpenBSD__)
> + #define RENDERDOC_CC
> + #elif defined(__APPLE__)
> + #define RENDERDOC_CC
> Index: patches/patch-code_libs_renderdoc_renderdoc_cpp
> ===================================================================
> RCS file: patches/patch-code_libs_renderdoc_renderdoc_cpp
> diff -N patches/patch-code_libs_renderdoc_renderdoc_cpp
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-code_libs_renderdoc_renderdoc_cpp   4 Sep 2020 21:42:54 
> -0000
> @@ -0,0 +1,16 @@
> +$OpenBSD$
> +
> +we don't have RTLD_NOLOAD
> +
> +Index: code/libs/renderdoc/renderdoc.cpp
> +--- code/libs/renderdoc/renderdoc.cpp.orig
> ++++ code/libs/renderdoc/renderdoc.cpp
> +@@ -14,7 +14,7 @@ RENDERDOC_API_1_1_1* api = nullptr;
> + 
> + pRENDERDOC_GetAPI load_getAPI() {
> + #ifdef SCP_UNIX
> +-    auto handle = dlopen("librenderdoc.so", RTLD_NOLOAD);
> ++    auto handle = dlopen("librenderdoc.so", RTLD_LAZY);
> +     auto symbol = dlsym(handle, "RENDERDOC_GetAPI");
> + 
> +     if (handle != nullptr) {
> Index: patches/patch-code_network_gtrack_cpp
> ===================================================================
> RCS file: patches/patch-code_network_gtrack_cpp
> diff -N patches/patch-code_network_gtrack_cpp
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-code_network_gtrack_cpp     4 Sep 2020 21:42:54 -0000
> @@ -0,0 +1,17 @@
> +$OpenBSD$
> +
> +include sys/socket.h, needed for AF_INET
> +
> +Index: code/network/gtrack.cpp
> +--- code/network/gtrack.cpp.orig
> ++++ code/network/gtrack.cpp
> +@@ -25,6 +25,9 @@
> + #include "network/ptrack.h"
> + #include "network/multi_fstracker.h"
> + 
> ++#ifdef __OpenBSD__
> ++#include <sys/socket.h>
> ++#endif
> + 
> + // check structs for size compatibility
> + SDL_COMPILE_TIME_ASSERT(game_packet_header, sizeof(game_packet_header) == 
> 529);
> Index: patches/patch-code_network_multi_portfwd_cpp
> ===================================================================
> RCS file: patches/patch-code_network_multi_portfwd_cpp
> diff -N patches/patch-code_network_multi_portfwd_cpp
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-code_network_multi_portfwd_cpp      4 Sep 2020 21:42:54 
> -0000
> @@ -0,0 +1,17 @@
> +$OpenBSD$
> +
> +supply AI_V4MAPPED
> +
> +Index: code/network/multi_portfwd.cpp
> +--- code/network/multi_portfwd.cpp.orig
> ++++ code/network/multi_portfwd.cpp
> +@@ -7,6 +7,9 @@
> +  *
> + */
> + 
> ++/* not supplied in headers */
> ++#define AI_V4MAPPED                 0x00000800
> ++
> + #ifdef _WIN32
> + #include <winsock2.h>
> + #include <ws2tcpip.h>
> Index: patches/patch-code_network_ptrack_cpp
> ===================================================================
> RCS file: patches/patch-code_network_ptrack_cpp
> diff -N patches/patch-code_network_ptrack_cpp
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-code_network_ptrack_cpp     4 Sep 2020 21:42:54 -0000
> @@ -0,0 +1,17 @@
> +$OpenBSD$
> +
> +include sys/socket.h needed for AF_INET
> +
> +Index: code/network/ptrack.cpp
> +--- code/network/ptrack.cpp.orig
> ++++ code/network/ptrack.cpp
> +@@ -25,6 +25,9 @@
> + #include "network/psnet2.h"
> + #include "network/multi_fstracker.h"
> + 
> ++#ifdef __OpenBSD__
> ++#include <sys/socket.h>
> ++#endif
> + 
> + // check structs for size compatibility
> + SDL_COMPILE_TIME_ASSERT(udp_packet_header, sizeof(udp_packet_header) == 
> 497);
> Index: patches/patch-code_network_valid_cpp
> ===================================================================
> RCS file: patches/patch-code_network_valid_cpp
> diff -N patches/patch-code_network_valid_cpp
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-code_network_valid_cpp      4 Sep 2020 21:42:54 -0000
> @@ -0,0 +1,17 @@
> +$OpenBSD$
> +
> +include sys/socket.h
> +
> +Index: code/network/valid.cpp
> +--- code/network/valid.cpp.orig
> ++++ code/network/valid.cpp
> +@@ -27,6 +27,9 @@
> + #include "network/multi_fstracker.h"
> + #include "io/timer.h"
> + 
> ++#ifdef __OpenBSD__
> ++#include <sys/socket.h>
> ++#endif
> + 
> + // check structs for size compatibility
> + SDL_COMPILE_TIME_ASSERT(vmt_validate_mission_req_struct, 
> sizeof(vmt_validate_mission_req_struct) == 104);
> Index: patches/patch-code_osapi_dialogs_cpp
> ===================================================================
> RCS file: patches/patch-code_osapi_dialogs_cpp
> diff -N patches/patch-code_osapi_dialogs_cpp
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-code_osapi_dialogs_cpp      4 Sep 2020 21:42:54 -0000
> @@ -0,0 +1,18 @@
> +$OpenBSD$
> +
> +disable breaking on error with SDL_ShowMessageBox()
> +this is a backport of a part of commit
> +7f286b726d70904e46acac54dbc44ba3d4e8dad7
> +
> +Index: code/osapi/dialogs.cpp
> +--- code/osapi/dialogs.cpp.orig
> ++++ code/osapi/dialogs.cpp
> +@@ -403,7 +403,7 @@ namespace os
> +                     if (SDL_ShowMessageBox(&boxData, &buttonId) < 0)
> +                     {
> +                             // Call failed
> +-                            abort();
> ++                            buttonId = 1; // No action
> +                     }
> + 
> +                     switch (buttonId)
> Index: patches/patch-lib_CMakeLists_txt
> ===================================================================
> RCS file: patches/patch-lib_CMakeLists_txt
> diff -N patches/patch-lib_CMakeLists_txt
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-lib_CMakeLists_txt  4 Sep 2020 21:42:54 -0000
> @@ -0,0 +1,16 @@
> +$OpenBSD$
> +
> +disable bundled SDL
> +
> +Index: lib/CMakeLists.txt
> +--- lib/CMakeLists.txt.orig
> ++++ lib/CMakeLists.txt
> +@@ -13,8 +13,6 @@ include(OpenAL.cmake)
> + 
> + add_subdirectory(opengl)
> + 
> +-ADD_SUBDIRECTORY(libsdl)
> +-
> + ADD_SUBDIRECTORY(jansson)
> + # These are only required for the web-ui which is non-Windows
> + IF(UNIX)
> Index: patches/patch-lib_libRocket_Include_Rocket_Core_Lua_Interpreter_h
> ===================================================================
> RCS file: patches/patch-lib_libRocket_Include_Rocket_Core_Lua_Interpreter_h
> diff -N patches/patch-lib_libRocket_Include_Rocket_Core_Lua_Interpreter_h
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-lib_libRocket_Include_Rocket_Core_Lua_Interpreter_h 4 Sep 
> 2020 21:42:54 -0000
> @@ -0,0 +1,31 @@
> +$OpenBSD$
> +
> +_L -> _LuaState to avoid clash with macro in ctype.h
> +
> +Index: lib/libRocket/Include/Rocket/Core/Lua/Interpreter.h
> +--- lib/libRocket/Include/Rocket/Core/Lua/Interpreter.h.orig
> ++++ lib/libRocket/Include/Rocket/Core/Lua/Interpreter.h
> +@@ -103,7 +103,7 @@ class ROCKETLUA_API Interpreter : public Plugin (publi
> +      must call lua_close yourself or if you need to continue to use the 
> lua_State pointer provided here.  Internally, it calls
> +      Interpreter::Startup() and registers the "body" tag to generate a 
> LuaDocument rather than a Rocket::Core::ElementDocument.
> +      If the argument provided is NULL, a Lua context is created 
> automatically instead. */
> +-    static void Initialise(lua_State *_L);
> ++    static void Initialise(lua_State *_LuaState);
> + 
> +     /** Stops the plugin by calling lua_close
> +      @remark Shutdown calls lua_Close on the lua_State associated with the 
> Interpreter.  If a lua_State was provided in the
> +@@ -118,12 +118,12 @@ class ROCKETLUA_API Interpreter : public Plugin (publi
> +     @sa Rocket::Core::Plugin::OnShutdown    */
> +     virtual void OnShutdown();
> + private:
> +-    /** Creates a lua_State for @var _L and calls luaL_openlibs, then calls 
> Interpreter::RegisterCoreTypes(lua_State*)
> ++    /** Creates a lua_State for @var _LuaState and calls luaL_openlibs, 
> then calls Interpreter::RegisterCoreTypes(lua_State*)
> +     @remark called by Interpreter::Initialise()    */
> +     void Startup();
> + 
> +     /** Lua state that Interpreter::Initialise() creates.    */
> +-    static lua_State* _L;
> ++    static lua_State* _LuaState;
> + };
> + }
> + }
> Index: patches/patch-lib_libRocket_Source_Core_Lua_Interpreter_cpp
> ===================================================================
> RCS file: patches/patch-lib_libRocket_Source_Core_Lua_Interpreter_cpp
> diff -N patches/patch-lib_libRocket_Source_Core_Lua_Interpreter_cpp
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-lib_libRocket_Source_Core_Lua_Interpreter_cpp       4 Sep 
> 2020 21:42:54 -0000
> @@ -0,0 +1,181 @@
> +$OpenBSD$
> +
> +_L -> _LuaState to avoid clash with macro in ctype.h
> +
> +Index: lib/libRocket/Source/Core/Lua/Interpreter.cpp
> +--- lib/libRocket/Source/Core/Lua/Interpreter.cpp.orig
> ++++ lib/libRocket/Source/Core/Lua/Interpreter.cpp
> +@@ -60,19 +60,19 @@
> + namespace Rocket {
> + namespace Core {
> + namespace Lua {
> +-lua_State* Interpreter::_L = NULL;
> ++lua_State* Interpreter::_LuaState = NULL;
> + //typedefs for nicer Lua names
> + typedef Rocket::Core::ElementDocument Document;
> + 
> + void Interpreter::Startup()
> + {
> +-    if(_L == NULL)
> ++    if(_LuaState == NULL)
> +     {
> +             Log::Message(Log::LT_INFO, "Loading Lua interpreter");
> +-            _L = luaL_newstate();
> +-            luaL_openlibs(_L);
> ++            _LuaState = luaL_newstate();
> ++            luaL_openlibs(_LuaState);
> +     }
> +-    RegisterCoreTypes(_L);
> ++    RegisterCoreTypes(_LuaState);
> + }
> + 
> + 
> +@@ -111,27 +111,27 @@ void Interpreter::LoadFile(const String& file)
> +     Rocket::Core::FileInterface* file_interface = 
> Rocket::Core::GetFileInterface();
> +     Rocket::Core::FileHandle handle = file_interface->Open(file);
> +     if(handle == 0) {
> +-        lua_pushfstring(_L, "LoadFile: Unable to open file: %s", 
> file.CString());
> +-        Report(_L);
> ++        lua_pushfstring(_LuaState, "LoadFile: Unable to open file: %s", 
> file.CString());
> ++        Report(_LuaState);
> +         return;
> +     }
> + 
> +     size_t size = file_interface->Length(handle);
> +     if(size == 0) {
> +-        lua_pushfstring(_L, "LoadFile: File is 0 bytes in size: %s", 
> file.CString());
> +-        Report(_L);
> ++        lua_pushfstring(_LuaState, "LoadFile: File is 0 bytes in size: %s", 
> file.CString());
> ++        Report(_LuaState);
> +         return;
> +     }
> +     char* file_contents = new char[size];
> +     file_interface->Read(file_contents,size,handle);
> +     file_interface->Close(handle);
> + 
> +-    if(luaL_loadbuffer(_L,file_contents,size,file.CString()) != 0)
> +-        Report(_L); 
> ++    if(luaL_loadbuffer(_LuaState,file_contents,size,file.CString()) != 0)
> ++        Report(_LuaState); 
> +     else //if there were no errors loading, then the compiled function is 
> on the top of the stack
> +     {
> +-        if(lua_pcall(_L,0,0,0) != 0)
> +-            Report(_L);
> ++        if(lua_pcall(_LuaState,0,0,0) != 0)
> ++            Report(_LuaState);
> +     }
> + 
> +     delete[] file_contents;
> +@@ -140,27 +140,27 @@ void Interpreter::LoadFile(const String& file)
> + 
> + void Interpreter::DoString(const Rocket::Core::String& code, const 
> Rocket::Core::String& name)
> + {
> +-    if(luaL_loadbuffer(_L,code.CString(),code.Length(), name.CString()) != 
> 0)
> +-        Report(_L);
> ++    if(luaL_loadbuffer(_LuaState,code.CString(),code.Length(), 
> name.CString()) != 0)
> ++        Report(_LuaState);
> +     else
> +     {
> +-        if(lua_pcall(_L,0,0,0) != 0)
> +-            Report(_L);
> ++        if(lua_pcall(_LuaState,0,0,0) != 0)
> ++            Report(_LuaState);
> +     }
> + }
> + 
> + void Interpreter::LoadString(const Rocket::Core::String& code, const 
> Rocket::Core::String& name)
> + {
> +-    if(luaL_loadbuffer(_L,code.CString(),code.Length(), name.CString()) != 
> 0)
> +-        Report(_L);
> ++    if(luaL_loadbuffer(_LuaState,code.CString(),code.Length(), 
> name.CString()) != 0)
> ++        Report(_LuaState);
> + }
> + 
> + 
> + void Interpreter::BeginCall(int funRef)
> + {
> +-    lua_settop(_L,0); //empty stack
> +-    //lua_getref(_L,funRef);
> +-    lua_rawgeti(_L, LUA_REGISTRYINDEX, (int)funRef);
> ++    lua_settop(_LuaState,0); //empty stack
> ++    //lua_getref(_LuaState,funRef);
> ++    lua_rawgeti(_LuaState, LUA_REGISTRYINDEX, (int)funRef);
> + }
> + 
> + int Interpreter::ErrorHandler(lua_State* L) {
> +@@ -196,8 +196,8 @@ int Interpreter::ErrorHandler(lua_State* L) {
> + bool Interpreter::ExecuteCall(int params, int res)
> + {
> +     bool ret = true;
> +-    int top = lua_gettop(_L);
> +-    if(lua_type(_L,top-params) != LUA_TFUNCTION)
> ++    int top = lua_gettop(_LuaState);
> ++    if(lua_type(_LuaState,top-params) != LUA_TFUNCTION)
> +     {
> +         ret = false;
> +         //stack cleanup
> +@@ -205,24 +205,24 @@ bool Interpreter::ExecuteCall(int params, int res)
> +         {
> +             for(int i = top; i >= (top-params); i--)
> +             {
> +-                if(!lua_isnone(_L,i))
> +-                    lua_remove(_L,i);
> ++                if(!lua_isnone(_LuaState,i))
> ++                    lua_remove(_LuaState,i);
> +             }
> +         }
> +     }
> +     else
> +     {
> +-            lua_pushcfunction(_L, ErrorHandler);
> +-            lua_insert(_L, -params - 2);
> ++            lua_pushcfunction(_LuaState, ErrorHandler);
> ++            lua_insert(_LuaState, -params - 2);
> + 
> +-        if(lua_pcall(_L,params,res,-params - 2) != 0)
> ++        if(lua_pcall(_LuaState,params,res,-params - 2) != 0)
> +         {
> +-            Report(_L);
> ++            Report(_LuaState);
> +             ret = false;
> +             res = 0;
> +         }
> + 
> +-        lua_remove(_L, -res - 1); // Remove error function from stack
> ++        lua_remove(_LuaState, -res - 1); // Remove error function from stack
> +     }
> +     return ret;
> + }
> +@@ -232,12 +232,12 @@ void Interpreter::EndCall(int res)
> +     //stack cleanup
> +     for(int i = res; i > 0; i--)
> +     {
> +-        if(!lua_isnone(_L,res))
> +-            lua_remove(_L,res);
> ++        if(!lua_isnone(_LuaState,res))
> ++            lua_remove(_LuaState,res);
> +     }
> + }
> + 
> +-lua_State* Interpreter::GetLuaState() { return _L; }
> ++lua_State* Interpreter::GetLuaState() { return _LuaState; }
> + 
> + 
> + //From Plugin
> +@@ -267,14 +267,14 @@ void Interpreter::Initialise()
> + void Interpreter::Initialise(lua_State *luaStatePointer)
> + {
> +     Interpreter *iPtr = new Interpreter();
> +-    iPtr->_L = luaStatePointer;
> ++    iPtr->_LuaState = luaStatePointer;
> +     Rocket::Core::RegisterPlugin(iPtr);
> + }
> + 
> + void Interpreter::Shutdown(bool free_state)
> + {
> +     if (free_state) {
> +-            lua_close(_L);
> ++            lua_close(_LuaState);
> +     }
> + }
> + 
> Index: patches/patch-lib_libpcp_src_net_gateway_c
> ===================================================================
> RCS file: patches/patch-lib_libpcp_src_net_gateway_c
> diff -N patches/patch-lib_libpcp_src_net_gateway_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-lib_libpcp_src_net_gateway_c        4 Sep 2020 21:42:54 
> -0000
> @@ -0,0 +1,14 @@
> +$OpenBSD$
> +
> +Index: lib/libpcp/src/net/gateway.c
> +--- lib/libpcp/src/net/gateway.c.orig
> ++++ lib/libpcp/src/net/gateway.c
> +@@ -62,7 +62,7 @@
> + #include "pcp_win_defines.h"
> + #endif
> + 
> +-#if defined(__APPLE__) || defined(__FreeBSD__)
> ++#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__)
> + #include <sys/sysctl.h>
> + #include <net/if_dl.h>          //struct sockaddr_dl
> + #define USE_SOCKET_ROUTE
> Index: patches/patch-lib_libpcp_src_net_sock_ntop_c
> ===================================================================
> RCS file: patches/patch-lib_libpcp_src_net_sock_ntop_c
> diff -N patches/patch-lib_libpcp_src_net_sock_ntop_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-lib_libpcp_src_net_sock_ntop_c      4 Sep 2020 21:42:54 
> -0000
> @@ -0,0 +1,18 @@
> +$OpenBSD$
> +
> +add missing define, as found in code/windows_stub/config.h and
> +lib/libpcp/src/windows/pcp_win_defines.h (identical)
> +
> +Index: lib/libpcp/src/net/sock_ntop.c
> +--- lib/libpcp/src/net/sock_ntop.c.orig
> ++++ lib/libpcp/src/net/sock_ntop.c
> +@@ -23,6 +23,9 @@
> +  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> +  */
> + 
> ++/* Doesn't get picked up from Windows header files, therefore added here: */
> ++#define AI_V4MAPPED                 0x00000800
> ++
> + #ifdef HAVE_CONFIG_H
> + #include "config.h"
> + #else
> Index: pkg/README
> ===================================================================
> RCS file: /cvs/ports/games/fs2open/pkg/README,v
> retrieving revision 1.2
> diff -u -p -r1.2 README
> --- pkg/README        4 Sep 2018 12:46:12 -0000       1.2
> +++ pkg/README        4 Sep 2020 21:42:54 -0000
> @@ -33,4 +33,13 @@ Mods
>  In order to run mods, create a folder for each mod in
>  ~/.local/share/fs2open and call fs2open like this:
>  
> -fs2open -mod <modfolder>
> +$ fs2open -mod <modfolder>
> +
> +Cursor Dyssynchrony
> +===================
> +
> +If mouse position doesn't match activity in the game (i.e. you need
> +over a different screen position than the button to activate the
> +button), try running the game windowed with set resolution, e.g.:
> +
> +$ fs2open -window -res 1600x900
> 

Reply via email to