From 77a0f47d06f3d21b78c7f34a129bc3f75d69fbf7 Mon Sep 17 00:00:00 2001 From: aszlig Date: Mon, 19 Feb 2018 04:32:32 +0100 Subject: games/gog: Add statically recompiled Albion We only fetch the data files from GOG here and use the port from OpenPandora (https://repo.openpandora.org/?page=detail&app=albion_sr) for the main game executable. Instead of using the binaries of the static recompiler, this is completely compiled from source and comes with a few changes in the form of a few patches: config.patch: Hide the mouse cursor and set the default scaled resolution to 1280x960 (the window can still be resized) in the default albion.cfg. error-log-stderr.patch: Whenever an error happens, the game usually creates a file called "error.log", which contains the actual error message. This patch makes sure the file isn't created but the error message is printed to stderr. scons.patch: Fixes a few SConstruct/SConscript files to use the builder's environment, so that it can find executables such as gcc. sdl2.patch: SDL 2 has dropped support for the keysym.unicode field at some point, so use keysym.sym instead. This has the disadvantage that it doesn't recognize key modifiers, so we might want to switch this to use the SDL_TEXTINPUT event. xdg-paths.patch: We want to use XDG_CONFIG_HOME and XDG_DATA_HOME instead of writing everything to one directory, so this patch makes sure that the paths are correctly read depending on whether its an XDG directory or one of the store paths of the game. Signed-off-by: aszlig --- pkgs/games/gog/albion/sdl2.patch | 60 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 pkgs/games/gog/albion/sdl2.patch (limited to 'pkgs/games/gog/albion/sdl2.patch') diff --git a/pkgs/games/gog/albion/sdl2.patch b/pkgs/games/gog/albion/sdl2.patch new file mode 100644 index 00000000..6b4bc93f --- /dev/null +++ b/pkgs/games/gog/albion/sdl2.patch @@ -0,0 +1,60 @@ +diff --git a/games/Albion/SR-Main/Albion-proc-events.c b/games/Albion/SR-Main/Albion-proc-events.c +index c323530..97eedd1 100644 +--- a/games/Albion/SR-Main/Albion-proc-events.c ++++ b/games/Albion/SR-Main/Albion-proc-events.c +@@ -893,19 +893,19 @@ void Game_ProcessKEvents(void) + else goto _after_switch1; + #endif + } +- else if ((cevent->key.keysym.unicode > 0) && (cevent->key.keysym.unicode < 128)) ++ else if ((cevent->key.keysym.sym > 0) && (cevent->key.keysym.sym < 128)) + { +- scancode = scancode_table[cevent->key.keysym.unicode]; +- ascii_code = cevent->key.keysym.unicode; ++ scancode = scancode_table[cevent->key.keysym.sym]; ++ ascii_code = cevent->key.keysym.sym; + } +- else if (cevent->key.keysym.unicode != 0) ++ else if (cevent->key.keysym.sym != 0) + { + scancode = 0; + ascii_code = 0; + + if ((ascii_code == 0) && (Albion_Font_Lang != AL_UNKNOWN)) + { +- switch (cevent->key.keysym.unicode) ++ switch (cevent->key.keysym.sym) + { + case 0x00E4: // ä + ascii_code = 0x84; +@@ -935,7 +935,7 @@ void Game_ProcessKEvents(void) + + if ((ascii_code == 0) && (Albion_Font_Lang == AL_ENG_FRE)) + { +- switch (cevent->key.keysym.unicode) ++ switch (cevent->key.keysym.sym) + { + case 0x00E9: // é + ascii_code = 0x82; +@@ -998,7 +998,7 @@ void Game_ProcessKEvents(void) + + if ((ascii_code == 0) && (Albion_Font_Lang == AL_CZE)) + { +- switch (cevent->key.keysym.unicode) ++ switch (cevent->key.keysym.sym) + { + case 0x00E9: // é + ascii_code = 0x82; +diff --git a/games/Albion/SR-Main/main.c b/games/Albion/SR-Main/main.c +index c9c3125..0d32bcb 100644 +--- a/games/Albion/SR-Main/main.c ++++ b/games/Albion/SR-Main/main.c +@@ -930,8 +930,6 @@ static void Game_Initialize2(void) + Init_Audio2(); + Init_Input2(); + +- SDL_EnableUNICODE(1); +- + Game_VideoAspectX = (360 << 16) / Picture_Width; + Game_VideoAspectY = (240 << 16) / Picture_Height; + -- cgit 1.4.1