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/fixveins.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/fixveins.cpp')
| -rw-r--r-- | plugins/fixveins.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/plugins/fixveins.cpp b/plugins/fixveins.cpp index de6ddf81..474201a8 100644 --- a/plugins/fixveins.cpp +++ b/plugins/fixveins.cpp @@ -34,16 +34,16 @@ bool setTileMaterial(df::tiletype &tile, const df::tiletype_material mat) return false; } -command_result df_fixveins (Core * c, vector <string> & parameters) +command_result df_fixveins (color_ostream &out, vector <string> & parameters) { if (parameters.size()) return CR_WRONG_USAGE; - CoreSuspender suspend(c); + CoreSuspender suspend; if (!Maps::IsValid()) { - c->con.printerr("Map is not available!\n"); + out.printerr("Map is not available!\n"); return CR_FAILURE; } @@ -90,15 +90,15 @@ command_result df_fixveins (Core * c, vector <string> & parameters) } } if (mineral_removed || feature_removed) - c->con.print("Removed invalid references from %i mineral inclusion and %i map feature tiles.\n", mineral_removed, feature_removed); + out.print("Removed invalid references from %i mineral inclusion and %i map feature tiles.\n", mineral_removed, feature_removed); if (mineral_added || feature_added) - c->con.print("Restored missing references to %i mineral inclusion and %i map feature tiles.\n", mineral_added, feature_added); + out.print("Restored missing references to %i mineral inclusion and %i map feature tiles.\n", mineral_added, feature_added); return CR_OK; } DFHACK_PLUGIN("fixveins"); -DFhackCExport command_result plugin_init ( Core * c, std::vector <PluginCommand> &commands) +DFhackCExport command_result plugin_init ( color_ostream &out, std::vector <PluginCommand> &commands) { commands.push_back(PluginCommand("fixveins", "Remove invalid references to mineral inclusions and restore missing ones.", @@ -106,7 +106,7 @@ 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; } |
