User:Gnanini/Divinity: Original Sin EE - GoG

From ArchWiki
Jump to navigation Jump to search


Tango-edit-clear.pngThis article or section needs language, wiki syntax or style improvements. See Help:Style for reference.Tango-edit-clear.png

Reason: Page just consists of code copied and pasted from Github. (Discuss in User talk:Gnanini/Divinity: Original Sin EE - GoG#)

GoG supports only ubuntu and related distibutions, but with this fix it's possible to enjoy this game on Archlinux using opensource drivers.

After installation create a file divos-hack.c on ~/GOG Games/Divinity Original Sin Enhanced Edition/game/, paste inside that file the following code:

~/GOG Games/Divinity Original Sin Enhanced Edition/game/divos-hack.c
 * LD_PRELOAD shim which applies two patches necesary to get the game
 * Divinity: Original Sin Enhanded Edition for Linux to work with Mesa (12+)
 * Build with: gcc -s -O2 -shared -fPIC -o divos-hack.{so,c} -ldl

/* for RTLD_NEXT */
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#include <dlfcn.h>
#include <GL/gl.h>
#include <string.h>

#define _GLX_PUBLIC

 *     - allow env override of vendor string.  I actually just hard-coded
 *       ATI Technologies, Inc., since that appears to be what's needed
const GLubyte *GLAPIENTRY glGetString( GLenum name )
    static void *next = NULL;
    static const char *vendor = "ATI Technologies, Inc.";
    if(name == GL_VENDOR)
	return (const GLubyte *)vendor;
	next = dlsym(RTLD_NEXT, "glGetString");
    return ((const GLubyte *GLAPIENTRY (*)(GLenum))next)(name);

_GLX_PUBLIC void (*glXGetProcAddressARB(const GLubyte * procName)) (void)
   static void *next = NULL;
   if (strcmp((const char *) procName, "glNamedStringARB") == 0

After that, compile it using this command:

# gcc -s -O2 -shared -fPIC -o divos-hack.{so,c} -ldl

Now, edit the file with the following lines:

~/GOG Games/Divinity Original Sin Enhanced Edition/game/

MESA_GLSL_VERSION_OVERRIDE=420 MESA_GL_VERSION_OVERRIDE=4.2 allow_glsl_extension_directive_midshader=true LD_PRELOAD="./" LD_LIBRARY_PATH="." ./EoCApp
# Restore resolution
xrandr --output eDP1 --mode 1920x1080 --rate 60

External Links

divos-hack.c on GitHub

Divinity: Original Sin may soon work with Mesa drivers on Gaming on Linux