From d130a7f8260a5c46e11b783c9810357a96ec8bf9 Mon Sep 17 00:00:00 2001 From: Riasan Date: Wed, 3 Jun 2020 12:38:33 +0200 Subject: [PATCH 1/2] Changed: fix client crash from opengl changes + fix compiling error because of moved client_default.cfg --- code/CMakeLists.txt | 13 ++++++++++--- .../3d/driver/opengl/driver_opengl_extension.cpp | 6 ++++++ .../src/3d/driver/opengl/driver_opengl_window.cpp | 3 +++ code/ryzom/client/CMakeLists.txt | 2 +- code/ryzom/client/src/CMakeLists.txt | 2 +- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 4c962537c..3225dc1b8 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -177,9 +177,16 @@ IF(WITH_STATIC) ENDIF() # under Linux and OS X, recent libxml2 versions are linked against libicu - FIND_PACKAGE(Icu) - IF(ICU_LIBRARIES) - SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${ICU_LIBRARIES} ${ICU_DATA_LIBRARIES}) + # FIND_PACKAGE(Icu) + FIND_LIBRARY(ICU_LIBRARY icuuc) + IF(ICU_LIBRARY) + FIND_LIBRARY(ICU_DATA_LIBRARY icudata) + IF(ICU_LIBRARY) + MESSAGE(STATUS "ICU UC was found: ${ICU_LIBRARY}") + ELSE() + MESSAGE(STATUS "ICU UC was NOT found") + ENDIF() + SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${ICU_DATA_LIBRARY} ${ICU_LIBRARY}) ENDIF() ENDIF() diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_extension.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_extension.cpp index c81ab9e1e..f7c0bf496 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_extension.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_extension.cpp @@ -1583,6 +1583,12 @@ static bool setupATIMeminfo(const char *glext) void registerGlExtensions(CGlExtensions &ext) { H_AUTO_OGL(registerGlExtensions); + + CGLContextObj ctx = CGLGetCurrentContext(); + if (ctx == NULL) + { + nlerror("No OpenGL context set"); + } // OpenGL 1.2 ?? const char *nglVersion = (const char *)glGetString (GL_VERSION); diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp index 293cb28bb..6537c289f 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_window.cpp @@ -1072,6 +1072,9 @@ bool CDriverGL::setDisplay(nlWindow wnd, const GfxMode &mode, bool show, bool re [_ctx flushBuffer]; [_glView display]; + // Set context as thread context + CGLSetCurrentContext((CGLContextObj)[_ctx CGLContextObj]); + _EventEmitter.init(this, _glView, _DestroyWindow); #elif defined(NL_OS_UNIX) diff --git a/code/ryzom/client/CMakeLists.txt b/code/ryzom/client/CMakeLists.txt index 7a6cf7424..2e17c230e 100644 --- a/code/ryzom/client/CMakeLists.txt +++ b/code/ryzom/client/CMakeLists.txt @@ -8,7 +8,7 @@ IF(WITH_RYZOM_CLIENT) ADD_SUBDIRECTORY(unix) ENDIF() - INSTALL(FILES client_default.cfg DESTINATION ${RYZOM_ETC_PREFIX}) + #INSTALL(FILES client_default.cfg DESTINATION ${RYZOM_ETC_PREFIX}) IF(WITH_RYZOM_PATCH) IF(APPLE) diff --git a/code/ryzom/client/src/CMakeLists.txt b/code/ryzom/client/src/CMakeLists.txt index 99b9a6773..7e1f89348 100644 --- a/code/ryzom/client/src/CMakeLists.txt +++ b/code/ryzom/client/src/CMakeLists.txt @@ -82,7 +82,7 @@ IF(WITH_RYZOM_CLIENT) ADD_CUSTOM_COMMAND(TARGET ryzom_client PRE_BUILD COMMAND mkdir -p ${RYZOM_RESOURCES_DIR}) ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp ARGS -p ${MAC_RESOURCES_DIR}/PkgInfo ${RYZOM_CONTENTS_DIR}) ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp ARGS -p ${MAC_RESOURCES_DIR}/ryzom.icns ${RYZOM_RESOURCES_DIR}) - ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp ARGS -p ${CMAKE_SOURCE_DIR}/ryzom/client/client_default.cfg ${RYZOM_RESOURCES_DIR}) + #ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND cp ARGS -p ${CMAKE_SOURCE_DIR}/ryzom/client/client_default.cfg ${RYZOM_RESOURCES_DIR}) # remove any present installscript_osx.vdf before signing ADD_CUSTOM_COMMAND(TARGET ryzom_client POST_BUILD COMMAND rm -f ${RYZOM_OUTPUT_DIR}/installscript_osx.vdf) From 107dbc1987b64041aa7532b7f4156f4e897fe954 Mon Sep 17 00:00:00 2001 From: Ulukyn Date: Fri, 26 Jun 2020 19:44:54 +0200 Subject: [PATCH 2/2] Changed: Fixed non-Mac compilation --- .../src/3d/driver/opengl/driver_opengl_extension.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_extension.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_extension.cpp index f7c0bf496..4bdd7ca97 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_extension.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_extension.cpp @@ -1275,7 +1275,7 @@ static bool setupNVFragmentProgram2(const char *glext) { H_AUTO_OGL(setupNVFragmentProgram2); CHECK_EXT("GL_NV_fragment_program2"); - + return true; } @@ -1284,7 +1284,7 @@ static bool setupARBFragmentShader(const char *glext) { H_AUTO_OGL(setupNVFragmentProgram2); CHECK_EXT("GL_ARB_fragment_shader"); - + return true; } @@ -1583,12 +1583,14 @@ static bool setupATIMeminfo(const char *glext) void registerGlExtensions(CGlExtensions &ext) { H_AUTO_OGL(registerGlExtensions); - + +#ifdef NL_OS_MAC CGLContextObj ctx = CGLGetCurrentContext(); if (ctx == NULL) { nlerror("No OpenGL context set"); } +#endif // OpenGL 1.2 ?? const char *nglVersion = (const char *)glGetString (GL_VERSION); @@ -1697,12 +1699,12 @@ void registerGlExtensions(CGlExtensions &ext) ext.EXTVertexShader = false; ext.ARBVertexProgram = false; } - + // Check pixel program // Disable feature ??? if (!ext.DisableHardwarePixelProgram) { - ext.ARBFragmentProgram = setupARBFragmentProgram(glext); + ext.ARBFragmentProgram = setupARBFragmentProgram(glext); ext.NVFragmentProgram2 = setupNVFragmentProgram2(glext); ext.ARBFragmentShader = setupARBFragmentShader(glext); }