diff options
| author | Alexander Gavrilov | 2012-03-10 15:55:42 +0400 |
|---|---|---|
| committer | Alexander Gavrilov | 2012-03-10 15:55:42 +0400 |
| commit | 8cc82d5876c902cbb4f0b3fa6cf15cf268dd942b (patch) | |
| tree | 4be7625f1bbe15b81d00373316047137d3422464 /plugins/initflags.cpp | |
| parent | b2737e2bed5f013a4dfbf6e19650ca60498a9afd (diff) | |
| download | dfhack-8cc82d5876c902cbb4f0b3fa6cf15cf268dd942b.tar.gz dfhack-8cc82d5876c902cbb4f0b3fa6cf15cf268dd942b.tar.bz2 dfhack-8cc82d5876c902cbb4f0b3fa6cf15cf268dd942b.tar.xz | |
Make plugins accept explicit output stream references.
This is an incompatible change to the plugin ABI.
The Console is not thread-safe unless used indirectly
via color_ostream_proxy, so everything should use their
per-thread stream.
Diffstat (limited to 'plugins/initflags.cpp')
| -rw-r--r-- | plugins/initflags.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/initflags.cpp b/plugins/initflags.cpp index 1125b625..6aa78930 100644 --- a/plugins/initflags.cpp +++ b/plugins/initflags.cpp @@ -14,12 +14,12 @@ using namespace df::enums; using df::global::d_init; -command_result twaterlvl(Core * c, vector <string> & parameters); -command_result tidlers(Core * c, vector <string> & parameters); +command_result twaterlvl(color_ostream &out, vector <string> & parameters); +command_result tidlers(color_ostream &out, vector <string> & parameters); DFHACK_PLUGIN("initflags"); -DFhackCExport command_result plugin_init (Core *c, std::vector <PluginCommand> &commands) +DFhackCExport command_result plugin_init (color_ostream &out, std::vector <PluginCommand> &commands) { if (d_init) { commands.push_back(PluginCommand("twaterlvl", "Toggle display of water/magma depth.", @@ -31,23 +31,23 @@ DFhackCExport command_result plugin_init (Core *c, std::vector <PluginCommand> & return CR_OK; } -DFhackCExport command_result plugin_shutdown ( Core * c ) +DFhackCExport command_result plugin_shutdown ( color_ostream &out ) { return CR_OK; } -command_result twaterlvl(Core * c, vector <string> & parameters) +command_result twaterlvl(color_ostream &out, vector <string> & parameters) { // HOTKEY COMMAND: CORE ALREADY SUSPENDED d_init->flags1.toggle(d_init_flags1::SHOW_FLOW_AMOUNTS); - c->con << "Toggled the display of water/magma depth." << endl; + out << "Toggled the display of water/magma depth." << endl; return CR_OK; } -command_result tidlers(Core * c, vector <string> & parameters) +command_result tidlers(color_ostream &out, vector <string> & parameters) { // HOTKEY COMMAND: CORE ALREADY SUSPENDED d_init->idlers = ENUM_NEXT_ITEM(d_init_idlers, d_init->idlers); - c->con << "Toggled the display of idlers to " << ENUM_KEY_STR(d_init_idlers, d_init->idlers) << endl; + out << "Toggled the display of idlers to " << ENUM_KEY_STR(d_init_idlers, d_init->idlers) << endl; return CR_OK; } |
