summaryrefslogtreecommitdiff
path: root/dev-libs/libgraphics/files
diff options
context:
space:
mode:
authoreroen2015-01-27 01:10:54 +0100
committereroen2015-01-27 09:37:19 +0100
commit78156d46d348350a06cca09fef66b8a8b5b76499 (patch)
treed700f408cb7f433e36d60c0f95eb034294e88e1d /dev-libs/libgraphics/files
parent6bb80dead917b2d33f1ffb80eca34269e6e87de5 (diff)
downloaderoen-overlay-78156d46d348350a06cca09fef66b8a8b5b76499.tar.gz
eroen-overlay-78156d46d348350a06cca09fef66b8a8b5b76499.tar.bz2
eroen-overlay-78156d46d348350a06cca09fef66b8a8b5b76499.tar.xz
libgraphics-40.24 - regenerate egg patch
Patched files changed line endings. :-( - Add ewarn for gcc-4.9, crashes on startup with unresolved symbol.
Diffstat (limited to 'dev-libs/libgraphics/files')
-rw-r--r--dev-libs/libgraphics/files/libgraphics-40.24-Add-something-eggy.patch129
1 files changed, 129 insertions, 0 deletions
diff --git a/dev-libs/libgraphics/files/libgraphics-40.24-Add-something-eggy.patch b/dev-libs/libgraphics/files/libgraphics-40.24-Add-something-eggy.patch
new file mode 100644
index 00000000..39f1beed
--- /dev/null
+++ b/dev-libs/libgraphics/files/libgraphics-40.24-Add-something-eggy.patch
@@ -0,0 +1,129 @@
+diff -urN a/df_linux/g_src/eggy.h b/df_linux/g_src/eggy.h
+--- a/df_linux/g_src/eggy.h 1970-01-01 01:00:00.000000000 +0100
++++ b/df_linux/g_src/eggy.h 2015-01-27 01:18:51.056581660 +0100
+@@ -0,0 +1,23 @@
++#pragma once
++#ifdef unix
++ #define EggyExport extern "C" __attribute__ ((visibility("default")))
++#else
++ #ifdef egg_internal
++ #define EggyExport extern "C" __declspec(dllexport)
++ #else
++ #define EggyExport extern "C" __declspec(dllimport)
++ #endif
++#endif
++
++// hook - called before rendering
++EggyExport int egg_init(void);
++// hook - called before rendering
++EggyExport int egg_shutdown(void);
++// hook - called for each game tick (or more often)
++EggyExport int egg_tick(void);
++// hook - called before rendering
++EggyExport int egg_prerender(void);
++// hook - called for each SDL event, returns 0 when the event has been consumed. 1 otherwise
++EggyExport int egg_sdl_event(void* event);
++// hook - ncurses event, -1 signifies error.
++EggyExport int egg_curses_event(int orig_return);
+\ No newline at end of file
+diff -urN a/df_linux/g_src/enabler.cpp b/df_linux/g_src/enabler.cpp
+--- a/df_linux/g_src/enabler.cpp 2015-01-07 21:14:50.000000000 +0100
++++ b/df_linux/g_src/enabler.cpp 2015-01-27 01:18:51.056581660 +0100
+@@ -11,6 +11,7 @@
+ #include "random.h"
+ #include "init.h"
+ #include "music_and_sound_g.h"
++#include "eggy.h"
+
+ #ifdef unix
+ # include <locale.h>
+@@ -346,7 +347,7 @@
+ if (async_frames < 0) async_frames = 0;
+ update_fps();
+ }
+- SDL_NumJoysticks(); // Hook for dfhack
++ egg_tick(); // Hook for dfhack
+ }
+ }
+
+@@ -433,6 +434,8 @@
+
+ // Check for SDL events
+ while (SDL_PollEvent(&event)) {
++ if(!egg_sdl_event(&event))
++ continue;
+ // Make sure mainloop isn't running while we're processing input
+ if (!paused_loop) {
+ pause_async_loop();
+@@ -574,6 +577,8 @@
+ } else {
+ renderer = new renderer_opengl();
+ }
++ // Tell the egg that we are ready to roll
++ egg_init();
+
+ // At this point we should have a window that is setup to render DF.
+ if (init.display.flag.has_flag(INIT_DISPLAY_FLAG_TEXT)) {
+@@ -584,6 +589,8 @@
+ SDL_EnableUNICODE(1);
+ eventLoop_SDL();
+ }
++ // Tell egg to leave
++ egg_shutdown();
+
+ endroutine();
+
+diff -urN a/df_linux/g_src/graphics.cpp b/df_linux/g_src/graphics.cpp
+--- a/df_linux/g_src/graphics.cpp 2015-01-07 21:14:50.000000000 +0100
++++ b/df_linux/g_src/graphics.cpp 2015-01-27 01:18:53.967607461 +0100
+@@ -17,6 +17,8 @@
+ #include "svector.h"
+ #include "ttf_manager.hpp"
+
++#include "eggy.h"
++
+ #ifdef WIN32
+
+ /*
+@@ -563,4 +565,6 @@
+ fps_locator(fps.size());
+ gps.addst(fps);
+ }
++ // tell egg to do its dirty obscure things
++ egg_prerender();
+ }
+diff -urN a/df_linux/g_src/renderer_curses.cpp b/df_linux/g_src/renderer_curses.cpp
+--- a/df_linux/g_src/renderer_curses.cpp 2015-01-07 21:14:50.000000000 +0100
++++ b/df_linux/g_src/renderer_curses.cpp 2015-01-27 01:18:55.784623565 +0100
+@@ -1,3 +1,5 @@
++#include "eggy.h"
++
+ static bool curses_initialized = false;
+
+ static void endwin_void() {
+@@ -134,17 +136,23 @@
+ }
+ };
+
++static int eggy_getch_wrapper()
++{
++ int byte = wgetch(*stdscr_p);
++ return egg_curses_event(byte);
++}
++
+ // Reads from getch, collapsing utf-8 encoding to the actual unicode
+ // character. Ncurses symbols (left arrow, etc.) are returned as
+ // positive values, unicode as negative. Error returns 0.
+ static int getch_utf8() {
+- int byte = wgetch(*stdscr_p);
++ int byte = eggy_getch_wrapper();
+ if (byte == ERR) return 0;
+ if (byte > 0xff) return byte;
+ int len = decode_utf8_predict_length(byte);
+ if (!len) return 0;
+ string input(len,0); input[0] = byte;
+- for (int i = 1; i < len; i++) input[i] = wgetch(*stdscr_p);
++ for (int i = 1; i < len; i++) input[i] = eggy_getch_wrapper();
+ return -decode_utf8(input);
+ }
+