avoid inducing link dependency on dfhack

develop
Myk Taylor 2023-07-05 11:07:51 -07:00
parent e3d3affdbc
commit 125e4c623b
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
3 changed files with 12 additions and 7 deletions

@ -1471,6 +1471,10 @@ std::string Core::getHackPath()
#endif
}
df::viewscreen * Core::getTopViewscreen() {
return getInstance().top_viewscreen;
}
bool Core::InitMainThread() {
Filesystem::init();
@ -1855,6 +1859,11 @@ void *Core::GetData( std::string key )
}
}
Core& Core::getInstance() {
static Core instance;
return instance;
}
bool Core::isSuspended(void)
{
return ownerThread.load() == std::this_thread::get_id();

@ -125,11 +125,7 @@ namespace DFHack
friend bool ::dfhooks_ncurses_key(int key);
public:
/// Get the single Core instance or make one.
static Core& getInstance()
{
static Core instance;
return instance;
}
static Core& getInstance();
/// check if the activity lock is owned by this thread
bool isSuspended(void);
/// Is everything OK?
@ -177,7 +173,7 @@ namespace DFHack
bool isWorldLoaded() { return (last_world_data_ptr != NULL); }
bool isMapLoaded() { return (last_local_map_ptr != NULL && last_world_data_ptr != NULL); }
static df::viewscreen *getTopViewscreen() { return getInstance().top_viewscreen; }
static df::viewscreen *getTopViewscreen();
DFHack::Console &getConsole() { return con; }

@ -1709,7 +1709,7 @@ bool Gui::autoDFAnnouncement(df::report_init r, string message)
if (a_flags.bits.D_DISPLAY)
{
world->status.display_timer = r.display_timer;
Gui::writeToGamelog("x" + to_string(repeat_count + 1));
Gui::writeToGamelog('x' + to_string(repeat_count + 1));
}
DEBUG(gui).print("Announcement succeeded as repeat:\n%s\n", message.c_str());
return true;