Skip to content

Commit 1138f51

Browse files
committed
add symbol lookup functions for dfsdl and dfimg
1 parent 0ca0f4d commit 1138f51

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

library/include/modules/DFSDL.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ bool init(DFHack::color_ostream &out);
3939
*/
4040
void cleanup();
4141

42+
DFHACK_EXPORT void * lookup_DFSDL_Symbol(const char *name);
43+
DFHACK_EXPORT void * lookup_DFIMG_Symbol(const char *name);
4244
DFHACK_EXPORT SDL_Surface * DFIMG_Load(const char *file);
4345
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);
4446
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);

library/modules/DFSDL.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,18 @@ void DFSDL::cleanup() {
107107
}
108108
}
109109

110+
void * DFSDL::lookup_DFSDL_Symbol(const char *name) {
111+
if (!g_sdl_handle)
112+
return nullptr;
113+
return LookupPlugin(g_sdl_handle, name);
114+
}
115+
116+
void * DFSDL::lookup_DFIMG_Symbol(const char *name) {
117+
if (!g_sdl_image_handle)
118+
return nullptr;
119+
return LookupPlugin(g_sdl_image_handle, name);
120+
}
121+
110122
SDL_Surface * DFSDL::DFIMG_Load(const char *file) {
111123
return g_IMG_Load(file);
112124
}

0 commit comments

Comments
 (0)