diff --git a/depends/dfhooks b/depends/dfhooks index d888c8bd52..5b70cd886f 160000 --- a/depends/dfhooks +++ b/depends/dfhooks @@ -1 +1 @@ -Subproject commit d888c8bd52f9eb83d0f5fee2242797e222522de1 +Subproject commit 5b70cd886f619b503aa770008fb79aa39a3be6fa diff --git a/library/Hooks.cpp b/library/Hooks.cpp index 68d6656bd8..951472eba6 100644 --- a/library/Hooks.cpp +++ b/library/Hooks.cpp @@ -51,7 +51,7 @@ DFhackCExport void dfhooks_update() { DFhackCExport void dfhooks_prerender() { if (disabled) return; - // TODO: render overlay widgets that are not attached to a viewscreen + // TODO: potentially render overlay elements that are not attached to a viewscreen } // called from the main thread for each SDL event. if true is returned, then @@ -62,6 +62,14 @@ DFhackCExport bool dfhooks_sdl_event(SDL_Event* event) { return DFHack::Core::getInstance().DFH_SDL_Event(event); } +// called from the main thread just after setting mouse state in gps and just +// before rendering the screen buffer to the screen. +DFhackCExport void dfhooks_sdl_loop() { + if (disabled) + return; + // TODO: wire this up to the new SDL-based console once it is merged +} + // called from the main thread for each utf-8 char read from the ncurses input // key is positive for ncurses keys and negative for everything else // if true is returned, then the event has been consumed and further processing diff --git a/library/include/Hooks.h b/library/include/Hooks.h index fb72fdbe35..6945de2ea6 100644 --- a/library/include/Hooks.h +++ b/library/include/Hooks.h @@ -31,4 +31,5 @@ DFhackCExport void dfhooks_shutdown(); DFhackCExport void dfhooks_update(); DFhackCExport void dfhooks_prerender(); DFhackCExport bool dfhooks_sdl_event(SDL_Event* event); +DFhackCExport void dfhooks_sdl_loop(); DFhackCExport bool dfhooks_ncurses_key(int key);