ptitSeb / ArxLibertatis

Cross-platform port of Arx Fatalis, a first-person role-playing game. Status: Working
http://arx-libertatis.org/
GNU General Public License v3.0
8 stars 0 forks source link

Building this or current version #1

Open clort81 opened 4 years ago

clort81 commented 4 years ago

Hi ptitSeb! Been reviewing your work here. Very cool stuff.

Do you have any interest in the updated Arx Libertatis? dscharrer has been real busy.

I've tried building the upstream master and it seems to require libGL - it picks up gl4es and then i get the 3 textures when two only available error [E] SDL1Window:222 Not enough GL texture units available: have 2, need at least 3

Naively trying to build your tree (on omap4, devuan) gets me

user@ml1:/big/arxes/ArxLibertatis/build$ cmake ..
-- Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY) 

though i do have from gl4es

/usr/lib/arm-linux-gnueabihf/libGL.so
/usr/lib/arm-linux-gnueabihf/libGL.so.1

Would love to get Arx runing on droid4! Any interest in updated build for pyra (with native gl-es not opengl)?

Cheers!

ptitSeb commented 4 years ago

I may try to update, but not sure a dedicate repo is still needed. That repo have a few NEON optim and a GLES1.1 backend, but those 2 things are difficult to port upstream, so if they disapear, that repo as no purpose.

About the number of texture. 2 is very little. What kind of hardware is that? Is it using GLES1.1 or GLES2 backend on gl4es?

clort81 commented 4 years ago

Is Omap4.

I'll see what i can do. Neither this repo nor upstream builds for me. Err sorry.

Upstream does build but it wants gl4es and log says.

[I] Startup:163           Starting Arx Libertatis 1.2-dev + 7c9760c
[I] ArxGame:342           Using config file "/home/user/.config/arx/cfg.ini"
[I] ArxGame:289           Changing filenames to lowercase...
[I] SDL1Window:81         Using SDL 1.2.15
[I] OpenGLRenderer:114    Using OpenGL 2.1 gl4es wrapper 1.1.3
[I] OpenGLRenderer:118     ├─ Vendor: ptitSeb
[I] OpenGLRenderer:122     ├─ Device: GL4ES wrapper
[I] OpenGLRenderer:189     └─ VRAM: (unknown)
[E] SDL1Window:222        Not enough GL texture units available: have 2, need at least 3
[CRITICAL] ArxGame:471    Graphics initialization failed
[CRITICAL] Core:249       Initialization failed
[I] ArxGame:993           Clean shutdown

so i need to figure out how you built against gles1.1

Oh yes also export LIBGL_ES=1 gets things further

/ArxLibertatis/build$ ./arx
[I] Startup:163          Starting Arx Libertatis 1.2-dev + 7c9760c
[I] ArxGame:342          Using config file "/home/user/.config/arx/cfg.ini"
[I] ArxGame:289          Changing filenames to lowercase...
[I] SDL1Window:81        Using SDL 1.2.15
LIBGL: Initialising gl4es
LIBGL: v1.1.3 built on Apr 27 2020 12:28:02
LIBGL: Using GLES 1.1 backend
LIBGL: loaded: libGLESv1_CM.so
LIBGL: loaded: libEGL.so
LIBGL: Using GLES 1.1 backend
PVR:(Warning): LoadWSModule: Window system module libpvrws_KMS.so did not validate native display [98, /generic_ws.c]
PVR:(Warning): LoadWSModule: Window system module libpvrws_WAYLAND.so did not validate native display [98, /generic_ws.c]
PVR:(Warning): PVRSRVOpenDCDevice: Warning - 138 returned [80, /bridged_pvr_dc_glue.c]
LIBGL: Hardware Limited NPOT detected and used
LIBGL: Extension GL_OES_framebuffer_object detected and used
LIBGL: Extension GL_OES_point_sprite detected and used
LIBGL: Extension GL_OES_point_size_array detected
LIBGL: Extension GL_OES_texture_cube_map detected and used
LIBGL: Extension GL_OES_blend_subtract detected and used
LIBGL: Extension GL_OES_blend_func_separate detected and used
LIBGL: Extension GL_OES_blend_equation_separate detected and used
LIBGL: Extension GL_OES_texture_mirrored_repeat detected and used
LIBGL: Extension GL_OES_mapbuffer detected
LIBGL: Extension GL_OES_depth24 detected and used
LIBGL: Extension GL_OES_rgb8_rgba8 detected and used
LIBGL: Extension GL_EXT_multi_draw_arrays detected
LIBGL: Extension GL_EXT_texture_format_BGRA8888 detected and used
LIBGL: Extension GL_OES_draw_texture detected and used
LIBGL: Max texture size: 2048
LIBGL: Texture Units: 4/4 (hardware: 4), Max lights: 8, Max planes: 6
LIBGL: Max Draw buffers: 1
LIBGL: Hardware vendor is Imagination Technologies
PVR:(Warning): PVRDRMSetFD: DRM fd already set [57, /pvr_bridge_u.c]
LIBGL: Targeting OpenGL 1.5
LIBGL: Forcing NPOT support by disabling MIPMAP support for NPOT textures 
LIBGL: Not trying to batch small subsequent glDrawXXXX
LIBGL: FBO workaround for using binded texture enabled
LIBGL: glX Will try to recycle EGL Surface
LIBGL: Current folder is:/big/ArxLibertatis/build
PVR:(Warning): LoadWSModule: Window system module libpvrws_KMS.so did not validate native display [98, /generic_ws.c]
PVR:(Warning): LoadWSModule: Window system module libpvrws_WAYLAND.so did not validate native display [98, /generic_ws.c]
PVR:(Warning): PVRSRVOpenDCDevice: Warning - 138 returned [80, /bridged_pvr_dc_glue.c]
[I] SDL1Window:237       Window: r:8 g:8 b:8 a:8 depth:32 aa:1x doublebuffer:1
[I] OpenGLRenderer:114   Using OpenGL 1.5 gl4es wrapper 1.1.3
[I] OpenGLRenderer:118    ├─ Vendor: ptitSeb
[I] OpenGLRenderer:122    ├─ Device: GL4ES wrapper
[I] OpenGLRenderer:189    └─ VRAM: (unknown)
[W] OpenGLRenderer:284   Missing OpenGL extension ARB_texture_non_power_of_two.
[I] ArxGame:1097         Changed fullscreen mode to 960x540
[I] PakReader:588        Loaded PAK "/home/user/.local/share/arx/data/data.pak"
[I] PakReader:588        Loaded PAK "/home/user/.local/share/arx/data/loc.pak"
[I] PakReader:588        Loaded PAK "/home/user/.local/share/arx/data/data2.pak"
[I] PakReader:588        Loaded PAK "/home/user/.local/share/arx/data/sfx.pak"
[I] PakReader:588        Loaded PAK "/home/user/.local/share/arx/data/speech.pak"
[I] PakReader:637        Added dir "/usr/local/share/games/arx/localisation"
[I] PakReader:637        Added dir "/usr/local/share/games/arx/misc"
[I] PakReader:637        Added dir "/big/ArxLibertatis/data/core/localisation"
[I] PakReader:637        Added dir "/big/ArxLibertatis/data/core/misc"
[I] PakReader:637        Added dir "/home/user/.local/share/arx/data/graph"
[I] PakReader:637        Added dir "/home/user/.local/share/arx/data/misc"
[I] SaveGame:69          Using save game dir "/home/user/.local/share/arx/save"
[I] OpenALBackend:303    Using OpenAL 1.1 ALSOFT 1.19.1 with EFX 1.0
[I] OpenALBackend:343     ├─ Vendor: OpenAL Community
[I] OpenALBackend:347     ├─ Renderer: OpenAL Soft
[I] OpenALBackend:372     ├─ Device: ALSA Default
[I] OpenALBackend:375     └─ HRTF: Disabled
[W] CrashReporter:49     Arx Libertatis Crash Reporter starting!
[I] Localisation:369     Autodetected text language: english
[I] Localisation:190     Multiple audio languages available: deutsch, english, francais
[I] Localisation:386     Autodetected audio language: english
[I] Localisation:237     Loading: xtext_default_001_arxlibertatis.ini
[I] Localisation:237     Loading: xtext_english_001_arxlibertatis.ini
[I] ScriptEvent:448      Scripting system initialized with 174 commands and 200 suppressions
[I] FontCache:194        Using FreeType 2.9.1
[I] Text:443             Loaded font "misc/arx.ttf" with sizes 45, 24, 15, 31, 19, 19, 19, 12
Aborted (core dumped)

bt in gdb is not really helping me much

Thread 6 "arx" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0xb30ff3a0 (LWP 20935)]
Thread::entryPoint (param=0x81000010) at /usr/include/c++/8/bits/basic_string.h:2290
2290          c_str() const _GLIBCXX_NOEXCEPT
(gdb) bt
#0  Thread::entryPoint (param=0x81000010) at /usr/include/c++/8/bits/basic_string.h:2290
#1  0xb6f8fbbe in start_thread (arg=0x6bf68d8a) at pthread_create.c:486
#2  0xb6aac62c in ?? () at ../sysdeps/unix/sysv/linux/arm/clone.S:73 from /lib/arm-linux-gnueabihf/libc.so.6
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) 
clort81 commented 4 years ago

New build gets me further \o/

LIBGL: Extension GL_OES_texture_cube_map detected and used
LIBGL: Extension GL_OES_blend_subtract detected and used
LIBGL: Extension GL_OES_blend_func_separate detected and used
LIBGL: Extension GL_OES_blend_equation_separate detected and used
LIBGL: Extension GL_OES_texture_mirrored_repeat detected and used
LIBGL: Extension GL_OES_mapbuffer detected
LIBGL: Extension GL_OES_depth24 detected and used
LIBGL: Extension GL_OES_rgb8_rgba8 detected and used
LIBGL: Extension GL_EXT_multi_draw_arrays detected
LIBGL: Extension GL_EXT_texture_format_BGRA8888 detected and used
LIBGL: Extension GL_OES_draw_texture detected and used
LIBGL: Max texture size: 2048
LIBGL: Texture Units: 4/4 (hardware: 4), Max lights: 8, Max planes: 6
LIBGL: Max Draw buffers: 1
LIBGL: Hardware vendor is Imagination Technologies
PVR:(Warning): PVRDRMSetFD: DRM fd already set [57, /pvr_bridge_u.c]
LIBGL: Targeting OpenGL 1.5
LIBGL: Forcing NPOT support by disabling MIPMAP support for NPOT textures 
LIBGL: Not trying to batch small subsequent glDrawXXXX
LIBGL: FBO workaround for using binded texture enabled
LIBGL: glX Will try to recycle EGL Surface
LIBGL: Current folder is:/big/arxes/ArxLibertatis/build
[I] Startup:182          Starting Arx Libertatis 1.1.1-git + 04021
[I] Application:227      Using config file "/home/user/.config/arx/cfg.ini"
[I] Application:174      Changing filenames to lowercase...
[I] SDLWindow:74         Using SDL 1.2.15
[W] ArxGame:310          Fullscreen mode 800x480@16 not supported, using 960x540@16 instead
EGL NOTICE: Unable to read ini settings from file 'eglport.cfg'. Using defaults
EGLport: Opening EGL display
EGLport: Using EGL_DEFAULT_DISPLAY
EGLport: Initializing
PVR:(Warning): PVRSRVOpenDCDevice: Warning - 138 returned [80, /bridged_pvr_dc_glue.c]
EGL Implementation Version: Major 1 Minor 4
EGL_VENDOR: Imagination Technologies
EGL_VERSION: 1.4 build 1.9@2253347
EGL_EXTENSIONS: EGL_IMG_client_api_ogl EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_vg_parent_image EGL_IMG_cl_image EGL_KHR_fence_sync EGL_IMG_hibernate_process EGL_WL_bind_wayland_display EGL_KHR_surfaceless_gles2 EGL_NV_post_sub_buffer 
EGLport: Found 2 available configs
EGLport: Using Config 0
EGLport: Binding API
EGLport: Creating Context
EGLport: Creating window surface
ERROR: Bad drawable!
EGLport ERROR: EGL Error detected in file /big/arxes/ArxLibertatis/src/window/eglport.cpp at line 280: EGL_BAD_NATIVE_WINDOW (0x300B)
  Description: An EGLNativeWindowType argument does not refer to a validnative window.
EGLport ERROR: Unable to create EGL surface!
[I] OpenGLRenderer:133   Using OpenGL 
[I] OpenGLRenderer:136    ├─ Vendor: 
[I] OpenGLRenderer:139    └─ Device: 
[I] ArxGame:543          Changed window size to 800x480
[E] ArxGame:2010         Arx Libertatis needs at least 3 texture units, but only 0 are available
[CRITICAL] ArxGame:369   Graphics initialization failed.
[CRITICAL] Application:114 Failed to initialize the windowing subsystem.
[CRITICAL] Core:534      Application failed to initialize properly.
LIBGL: Initialising gl4es
LIBGL: v1.1.3 built on Apr 27 2020 12:28:02
LIBGL: Using GLES 1.1 backend
LIBGL: loaded: libGLESv1_CM.so
LIBGL: loaded: libEGL.so
LIBGL: Using GLES 1.1 backend
PVR:(Warning): LoadWSModule: Window system module libpvrws_KMS.so did not validate native display [98, /generic_ws.c]
PVR:(Warning): LoadWSModule: Window system module libpvrws_WAYLAND.so did not validate native display [98, /generic_ws.c]
PVR:(Warning): PVRSRVOpenDCDevice: Warning - 138 returned [80, /bridged_pvr_dc_glue.c]
LIBGL: Hardware Limited NPOT detected and used
LIBGL: Extension GL_OES_framebuffer_object detected and used
LIBGL: Extension GL_OES_point_sprite detected and used
LIBGL: Extension GL_OES_point_size_array detected
LIBGL: Extension GL_OES_texture_cube_map detected and used
LIBGL: Extension GL_OES_blend_subtract detected and used
LIBGL: Extension GL_OES_blend_func_separate detected and used
LIBGL: Extension GL_OES_blend_equation_separate detected and used
LIBGL: Extension GL_OES_texture_mirrored_repeat detected and used
LIBGL: Extension GL_OES_mapbuffer detected
LIBGL: Extension GL_OES_depth24 detected and used
LIBGL: Extension GL_OES_rgb8_rgba8 detected and used
LIBGL: Extension GL_EXT_multi_draw_arrays detected
LIBGL: Extension GL_EXT_texture_format_BGRA8888 detected and used
LIBGL: Extension GL_OES_draw_texture detected and used
LIBGL: Max texture size: 2048
LIBGL: Texture Units: 4/4 (hardware: 4), Max lights: 8, Max planes: 6
LIBGL: Max Draw buffers: 1
LIBGL: Hardware vendor is Imagination Technologies
PVR:(Warning): PVRDRMSetFD: DRM fd already set [57, /pvr_bridge_u.c]
LIBGL: Targeting OpenGL 1.5
LIBGL: Forcing NPOT support by disabling MIPMAP support for NPOT textures 
LIBGL: Not trying to batch small subsequent glDrawXXXX
LIBGL: FBO workaround for using binded texture enabled
LIBGL: glX Will try to recycle EGL Surface
LIBGL: Current folder is:/big/arxes/ArxLibertatis/build
LIBGL: Shuting down
LIBGL: Shuting down

Actual GL-ES! Not gl4es

I think this is as minimal a config as I can do. not sure about epoxy vs glew.

 BUILD_CRASHHANDLER               OFF                                                                                  
 BUILD_CRASHREPORTER              OFF                                                                                  
 BUILD_EDITOR                     OFF                                                                                  
 BUILD_EDIT_LOADSAVE              ON                                                                                   
 BUILD_PROFILER_INSTRUMENT        OFF                                                                                  
 BUILD_TESTS                      OFF                                                                                  
 BUILD_TOOLS                      ON                                                                                   
 Boost_USE_STATIC_LIBS            OFF                                                                                  
 CMAKE_BUILD_TYPE                 Debug                                                                                
 CMAKE_INSTALL_PREFIX             /usr/local                                                                           
 CONTINUOUS_INTEGRATION           OFF                                                                                  
 DEBUG                            ON                                                                                   
 DEBUG_EXTRA                      OFF                                                                                  
 DESKTOP_FILE_VALIDATE            /usr/bin/desktop-file-validate                                                       
 DEVELOPER                        ON                                                                                   
 GLES                             ON                                                                                   
 GLEW_USE_STATIC_LIBS             ON                                                                                   
 ICONTHEMEDIR                     share/icons/hicolor                                                                  
 INSTALL_BLENDER_PLUGIN           OFF                                                                                  
 INSTALL_BLENDER_PLUGINDIR        share/blender/scripts/addons/arx                                                     
 INSTALL_SCRIPTS                  ON                                                                                   
 LIBRT_LIBRARY                    /usr/lib/arm-linux-gnueabihf/librt.so                                                
 OPTIMIZE_ICONS                   ON                                                                                   
 PANDORA                          ON                                                                                   
 QT_IMPORTS_DIR                   /usr/lib/arm-linux-gnueabihf/qt4/imports                                             
 QT_QMAKE_EXECUTABLE              /usr/bin/qmake                                                                       
 Qt5Core_DIR                      /usr/lib/arm-linux-gnueabihf/cmake/Qt5Core                                           
 Qt5Gui_DIR                       /usr/lib/arm-linux-gnueabihf/cmake/Qt5Gui                                            
 Qt5Network_DIR                   /usr/lib/arm-linux-gnueabihf/cmake/Qt5Network                                        
 Qt5Widgets_DIR                   /usr/lib/arm-linux-gnueabihf/cmake/Qt5Widgets                                        
 SDL_INCLUDE_DIR                  /usr/include/SDL                                                                     
 SDL_LIBRARY                      /usr/lib/arm-linux-gnueabihf/libSDL.so;-lpthread                                     
 SET_NOISY_WARNING_FLAGS          OFF                                                                                  
 SET_OPTIMIZATION_FLAGS           OFF                                                                                  
 SET_WARNING_FLAGS                ON                                                                                   
 STRICT_USE                       OFF                                                                                  
 UNITY_BUILD                      OFF                                                                                  
 USE_CXX11                        ON                                                                                   
 USE_NATIVE_FS                    ON                                                                                   
 USE_OPENAL                       ON                                                                                   
 USE_OPENGL                       ON                                                                                   
 USE_QT4                          ON                                                                                   
 USE_QT5                          OFF                                                                                  
 USE_SDL                          ON                                                                                   
 USE_STATIC_LIBS                  OFF                                                                                  
 USE_WAYLAND                      OFF                                                                                  
 USE_WINHTTP                      OFF                                                                                  
 WITH_OPENGL                      epoxy                                                                                
 pkgcfg_lib__PC_GLEW_GL           /usr/lib/arm-linux-gnueabihf/libGL.so                                                
 pkgcfg_lib__PC_GLEW_GLEW         /usr/lib/arm-linux-gnueabihf/libGLEW.so                                              
 pkgcfg_lib__PC_GLEW_GLU          /usr/lib/arm-linux-gnueabihf/libGLU.so  

cheers!

ptitSeb commented 4 years ago

there seems to be a mix between opengl and gles. Check the linked libs, if it's a gles build, remove the "libGL" that is linked (and maybe add -lEGL -lGLES_CM instead of -lGL ?)

clort81 commented 4 years ago

Thanks! I'll try that in Makefile. [EDIT] Not sure where to change this. Dont understand cmake well. Do i change it via ccmake .. ?

Btw. This got me game intro.

eglport.cpp

    eglSettings[CFG_MODE]           = RENDER_SDL;
//#else
// Clort    eglSettings[CFG_MODE]           = RENDER_RAW;

Now i fight with a different droid4 specific sdl error: fullscreen sdl window is shifted halfway down. But the game engine runs. arx

clort81 commented 4 years ago

Fixed our libSDL shifted-display issue! arx_sdl_fix Video http://0x0.st/i3qs.webm Thank you!