diff --git a/library/include/modules/DFSDL.h b/library/include/modules/DFSDL.h index 253f83aa7dd..bc3660b94db 100644 --- a/library/include/modules/DFSDL.h +++ b/library/include/modules/DFSDL.h @@ -39,6 +39,8 @@ bool init(DFHack::color_ostream &out); */ void cleanup(); +DFHACK_EXPORT void * lookup_DFSDL_Symbol(const char *name); +DFHACK_EXPORT void * lookup_DFIMG_Symbol(const char *name); DFHACK_EXPORT SDL_Surface * DFIMG_Load(const char *file); DFHACK_EXPORT SDL_Surface * DFSDL_CreateRGBSurface(uint32_t flags, int width, int height, int depth, uint32_t Rmask, uint32_t Gmask, uint32_t Bmask, uint32_t Amask); DFHACK_EXPORT SDL_Surface * DFSDL_CreateRGBSurfaceFrom(void *pixels, int width, int height, int depth, int pitch, uint32_t Rmask, uint32_t Gmask, uint32_t Bmask, uint32_t Amask); diff --git a/library/modules/DFSDL.cpp b/library/modules/DFSDL.cpp index f4a4017f9f7..e533899bc8f 100644 --- a/library/modules/DFSDL.cpp +++ b/library/modules/DFSDL.cpp @@ -107,6 +107,18 @@ void DFSDL::cleanup() { } } +void * DFSDL::lookup_DFSDL_Symbol(const char *name) { + if (!g_sdl_handle) + return nullptr; + return LookupPlugin(g_sdl_handle, name); +} + +void * DFSDL::lookup_DFIMG_Symbol(const char *name) { + if (!g_sdl_image_handle) + return nullptr; + return LookupPlugin(g_sdl_image_handle, name); +} + SDL_Surface * DFSDL::DFIMG_Load(const char *file) { return g_IMG_Load(file); }