diff --git a/plugins/Dfusion/dfusion.cpp b/plugins/Dfusion/dfusion.cpp index 7bba2217b..0cde3275f 100644 --- a/plugins/Dfusion/dfusion.cpp +++ b/plugins/Dfusion/dfusion.cpp @@ -28,8 +28,8 @@ static tthread::mutex* mymutex=0; static tthread::thread* thread_dfusion=0; uint64_t timeLast=0; -DFhackCExport command_result dfusion (Core * c, vector & parameters); -DFhackCExport command_result lua_run (Core * c, vector & parameters); +command_result dfusion (Core * c, vector & parameters); +command_result lua_run (Core * c, vector & parameters); DFhackCExport const char * plugin_name ( void ) { @@ -126,7 +126,7 @@ void InterpreterLoop(Core* c) } s.settop(0); } -DFhackCExport command_result lua_run (Core * c, vector & parameters) +command_result lua_run (Core * c, vector & parameters) { Console &con=c->con; mymutex->lock(); @@ -172,7 +172,7 @@ void RunDfusion(void *p) s.settop(0);// clean up mymutex->unlock(); } -DFhackCExport command_result dfusion (Core * c, vector & parameters) +command_result dfusion (Core * c, vector & parameters) { if(parameters[0]=="init") { diff --git a/plugins/autodump.cpp b/plugins/autodump.cpp index fd94e466e..8eb2fc628 100644 --- a/plugins/autodump.cpp +++ b/plugins/autodump.cpp @@ -32,9 +32,9 @@ using MapExtras::Block; using MapExtras::MapCache; using df::global::world; -DFhackCExport command_result df_autodump(Core * c, vector & parameters); -DFhackCExport command_result df_autodump_destroy_here(Core * c, vector & parameters); -DFhackCExport command_result df_autodump_destroy_item(Core * c, vector & parameters); +command_result df_autodump(Core * c, vector & parameters); +command_result df_autodump_destroy_here(Core * c, vector & parameters); +command_result df_autodump_destroy_item(Core * c, vector & parameters); DFhackCExport const char * plugin_name ( void ) { @@ -283,14 +283,14 @@ static command_result autodump_main(Core * c, vector & parameters) return CR_OK; } -DFhackCExport command_result df_autodump(Core * c, vector & parameters) +command_result df_autodump(Core * c, vector & parameters) { CoreSuspender suspend(c); return autodump_main(c, parameters); } -DFhackCExport command_result df_autodump_destroy_here(Core * c, vector & parameters) +command_result df_autodump_destroy_here(Core * c, vector & parameters) { // HOTKEY COMMAND; CORE ALREADY SUSPENDED if (!parameters.empty()) @@ -305,7 +305,7 @@ DFhackCExport command_result df_autodump_destroy_here(Core * c, vector static map pending_destroy; static int last_frame = 0; -DFhackCExport command_result df_autodump_destroy_item(Core * c, vector & parameters) +command_result df_autodump_destroy_item(Core * c, vector & parameters) { // HOTKEY COMMAND; CORE ALREADY SUSPENDED if (!parameters.empty()) diff --git a/plugins/cleaners.cpp b/plugins/cleaners.cpp index de46dac3d..ce7645da6 100644 --- a/plugins/cleaners.cpp +++ b/plugins/cleaners.cpp @@ -113,7 +113,7 @@ command_result cleanunits (Core * c) return CR_OK; } -DFhackCExport command_result spotclean (Core * c, vector & parameters) +command_result spotclean (Core * c, vector & parameters) { // HOTKEY COMMAND: CORE ALREADY SUSPENDED if (cursor->x == -30000) @@ -145,7 +145,7 @@ DFhackCExport command_result spotclean (Core * c, vector & parameters) return CR_OK; } -DFhackCExport command_result clean (Core * c, vector & parameters) +command_result clean (Core * c, vector & parameters) { bool map = false; bool snow = false; diff --git a/plugins/cleanowned.cpp b/plugins/cleanowned.cpp index c56e741c5..00aa85a9d 100644 --- a/plugins/cleanowned.cpp +++ b/plugins/cleanowned.cpp @@ -26,7 +26,7 @@ using namespace df::enums; using df::global::world; -DFhackCExport command_result df_cleanowned (Core * c, vector & parameters); +command_result df_cleanowned (Core * c, vector & parameters); DFhackCExport const char * plugin_name ( void ) { @@ -61,7 +61,7 @@ DFhackCExport command_result plugin_shutdown ( Core * c ) return CR_OK; } -DFhackCExport command_result df_cleanowned (Core * c, vector & parameters) +command_result df_cleanowned (Core * c, vector & parameters) { bool dump_scattered = false; bool confiscate_all = false; diff --git a/plugins/colonies.cpp b/plugins/colonies.cpp index f9c326cee..af6af8621 100644 --- a/plugins/colonies.cpp +++ b/plugins/colonies.cpp @@ -12,7 +12,7 @@ using std::string; using namespace DFHack; using namespace DFHack::Simple; -DFhackCExport command_result colonies (Core * c, vector & parameters); +command_result colonies (Core * c, vector & parameters); DFhackCExport const char * plugin_name ( void ) { @@ -42,7 +42,7 @@ void destroyColonies(); void convertColonies(Materials *Materials); void showColonies(Core *c, Materials *Materials); -DFhackCExport command_result colonies (Core * c, vector & parameters) +command_result colonies (Core * c, vector & parameters) { bool destroy = false; bool convert = false; diff --git a/plugins/deramp.cpp b/plugins/deramp.cpp index ac137b0f0..a47fa932a 100644 --- a/plugins/deramp.cpp +++ b/plugins/deramp.cpp @@ -17,7 +17,7 @@ using namespace df::enums; using df::global::world; -DFhackCExport command_result df_deramp (Core * c, vector & parameters) +command_result df_deramp (Core * c, vector & parameters) { if (!parameters.empty()) return CR_WRONG_USAGE; diff --git a/plugins/devel/buildprobe.cpp b/plugins/devel/buildprobe.cpp index f933c3846..3f8660164 100644 --- a/plugins/devel/buildprobe.cpp +++ b/plugins/devel/buildprobe.cpp @@ -18,15 +18,15 @@ using std::string; using std::stack; using namespace DFHack; -DFhackCExport DFHack::command_result readFlag (Core * c, vector & parameters); -DFhackCExport DFHack::command_result writeFlag (Core * c, vector & parameters); +command_result readFlag (Core * c, vector & parameters); +command_result writeFlag (Core * c, vector & parameters); DFhackCExport const char * plugin_name ( void ) { return "buildprobe"; } -DFhackCExport DFHack::command_result plugin_init ( Core * c, std::vector &commands) +DFhackCExport command_result plugin_init ( Core * c, std::vector &commands) { commands.clear(); commands.push_back(PluginCommand("bshow","Output building occupancy value",readFlag)); @@ -34,16 +34,16 @@ DFhackCExport DFHack::command_result plugin_init ( Core * c, std::vector & parameters) +command_result readFlag (Core * c, vector & parameters) { - c->Suspend(); + c->Suspend(); - DFHack::Gui * Gui = c->getGui(); + Gui * Gui = c->getGui(); // init the map if(!Maps::IsValid()) { @@ -52,7 +52,7 @@ DFhackCExport DFHack::command_result readFlag (Core * c, vector & param return CR_FAILURE; } - int32_t cx, cy, cz; + int32_t cx, cy, cz; Gui->getCursorCoords(cx,cy,cz); while(cx == -30000) { @@ -61,56 +61,56 @@ DFhackCExport DFHack::command_result readFlag (Core * c, vector & param return CR_FAILURE; } - DFHack::DFCoord cursor = DFHack::DFCoord(cx,cy,cz); + DFCoord cursor = DFCoord(cx,cy,cz); - MapExtras::MapCache * MCache = new MapExtras::MapCache(); - DFHack::t_occupancy oc = MCache->occupancyAt(cursor); + MapExtras::MapCache * MCache = new MapExtras::MapCache(); + t_occupancy oc = MCache->occupancyAt(cursor); - c->con.print("Current Value: %d\n", oc.bits.building); + c->con.print("Current Value: %d\n", oc.bits.building); - c->Resume(); - return CR_OK; + c->Resume(); + return CR_OK; } -DFhackCExport DFHack::command_result writeFlag (Core * c, vector & parameters) +command_result writeFlag (Core * c, vector & parameters) { - if (parameters.size() == 0) - { - c->con.print("No value specified\n"); - return CR_FAILURE; - } - - if (parameters[0] == "help" || parameters[0] == "?") - { - c->con.print("Set the building occupancy flag.\n" - "Value must be between 0 and 7, inclusive.\n"); - return CR_OK; - } - - char value; - - switch (parameters[0][0]) - { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - value = parameters[0][0] - '0'; - break; - - default: - c->con.print("Invalid value specified\n"); - return CR_FAILURE; - break; //Redundant. - } - - c->Suspend(); - - DFHack::Gui * Gui = c->getGui(); + if (parameters.size() == 0) + { + c->con.print("No value specified\n"); + return CR_FAILURE; + } + + if (parameters[0] == "help" || parameters[0] == "?") + { + c->con.print("Set the building occupancy flag.\n" + "Value must be between 0 and 7, inclusive.\n"); + return CR_OK; + } + + char value; + + switch (parameters[0][0]) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + value = parameters[0][0] - '0'; + break; + + default: + c->con.print("Invalid value specified\n"); + return CR_FAILURE; + break; //Redundant. + } + + c->Suspend(); + + Gui * Gui = c->getGui(); // init the map if(!Maps::IsValid()) { @@ -119,7 +119,7 @@ DFhackCExport DFHack::command_result writeFlag (Core * c, vector & para return CR_FAILURE; } - int32_t cx, cy, cz; + int32_t cx, cy, cz; Gui->getCursorCoords(cx,cy,cz); while(cx == -30000) { @@ -128,15 +128,15 @@ DFhackCExport DFHack::command_result writeFlag (Core * c, vector & para return CR_FAILURE; } - DFHack::DFCoord cursor = DFHack::DFCoord(cx,cy,cz); + DFCoord cursor = DFCoord(cx,cy,cz); - MapExtras::MapCache * MCache = new MapExtras::MapCache(); - DFHack::t_occupancy oc = MCache->occupancyAt(cursor); + MapExtras::MapCache * MCache = new MapExtras::MapCache(); + t_occupancy oc = MCache->occupancyAt(cursor); - oc.bits.building = value; - MCache->setOccupancyAt(cursor, oc); - MCache->WriteAll(); + oc.bits.building = value; + MCache->setOccupancyAt(cursor, oc); + MCache->WriteAll(); - c->Resume(); - return CR_OK; -} \ No newline at end of file + c->Resume(); + return CR_OK; +} diff --git a/plugins/devel/itemhacks.cpp b/plugins/devel/itemhacks.cpp index 208a146bd..0a84df28b 100644 --- a/plugins/devel/itemhacks.cpp +++ b/plugins/devel/itemhacks.cpp @@ -145,7 +145,7 @@ protected: // END item choosers ////////////////////// -DFhackCExport command_result df_dumpitems (Core * c, vector & parameters); +command_result df_dumpitems (Core * c, vector & parameters); DFhackCExport const char * plugin_name ( void ) { @@ -169,7 +169,7 @@ DFhackCExport command_result plugin_shutdown ( Core * c ) return CR_OK; } -DFhackCExport command_result df_dumpitems (Core * c, vector & parameters) +command_result df_dumpitems (Core * c, vector & parameters) { c->Suspend(); DFHack::Materials * Materials = c->getMaterials(); @@ -270,4 +270,4 @@ DFhackCExport command_result df_dumpitems (Core * c, vector & parameter return CR_OK; } -*/ \ No newline at end of file +*/ diff --git a/plugins/devel/kittens.cpp b/plugins/devel/kittens.cpp index 93cdf2107..ae19c9fee 100644 --- a/plugins/devel/kittens.cpp +++ b/plugins/devel/kittens.cpp @@ -27,11 +27,11 @@ int32_t last_mouse[2] = {-1, -1}; uint32_t last_menu = 0; uint64_t timeLast = 0; -DFhackCExport command_result kittens (Core * c, vector & parameters); -DFhackCExport command_result ktimer (Core * c, vector & parameters); -DFhackCExport command_result trackmenu (Core * c, vector & parameters); -DFhackCExport command_result trackpos (Core * c, vector & parameters); -DFhackCExport command_result colormods (Core * c, vector & parameters); +command_result kittens (Core * c, vector & parameters); +command_result ktimer (Core * c, vector & parameters); +command_result trackmenu (Core * c, vector & parameters); +command_result trackpos (Core * c, vector & parameters); +command_result colormods (Core * c, vector & parameters); DFhackCExport const char * plugin_name ( void ) { @@ -104,7 +104,7 @@ DFhackCExport command_result plugin_onupdate ( Core * c ) return CR_OK; } -DFhackCExport command_result trackmenu (Core * c, vector & parameters) +command_result trackmenu (Core * c, vector & parameters) { if(trackmenu_flg) { @@ -128,13 +128,13 @@ DFhackCExport command_result trackmenu (Core * c, vector & parameters) } } } -DFhackCExport command_result trackpos (Core * c, vector & parameters) +command_result trackpos (Core * c, vector & parameters) { trackpos_flg = !trackpos_flg; return CR_OK; } -DFhackCExport command_result colormods (Core * c, vector & parameters) +command_result colormods (Core * c, vector & parameters) { c->Suspend(); auto & vec = df::global::world->raws.creatures.alphabetic; @@ -152,7 +152,7 @@ DFhackCExport command_result colormods (Core * c, vector & parameters) return CR_OK; } -DFhackCExport command_result ktimer (Core * c, vector & parameters) +command_result ktimer (Core * c, vector & parameters) { if(timering) { @@ -170,7 +170,7 @@ DFhackCExport command_result ktimer (Core * c, vector & parameters) return CR_OK; } -DFhackCExport command_result kittens (Core * c, vector & parameters) +command_result kittens (Core * c, vector & parameters) { final_flag = false; Console & con = c->con; diff --git a/plugins/devel/memview.cpp b/plugins/devel/memview.cpp index 030eb4cdc..181a3aa71 100644 --- a/plugins/devel/memview.cpp +++ b/plugins/devel/memview.cpp @@ -28,7 +28,7 @@ enum HEXVIEW_STATES { STATE_OFF,STATE_ON }; -DFhackCExport command_result memview (Core * c, vector & parameters); +command_result memview (Core * c, vector & parameters); DFhackCExport const char * plugin_name ( void ) { @@ -139,7 +139,7 @@ DFhackCExport command_result plugin_onupdate ( Core * c ) return CR_OK; } -DFhackCExport command_result memview (Core * c, vector & parameters) +command_result memview (Core * c, vector & parameters) { mymutex->lock(); c->p->getMemRanges(memdata.ranges); diff --git a/plugins/devel/notes.cpp b/plugins/devel/notes.cpp index 412f64476..7e613181e 100644 --- a/plugins/devel/notes.cpp +++ b/plugins/devel/notes.cpp @@ -10,7 +10,7 @@ using std::vector; using std::string; using namespace DFHack; -DFhackCExport command_result df_notes (Core * c, vector & parameters); +command_result df_notes (Core * c, vector & parameters); DFhackCExport const char * plugin_name ( void ) { @@ -31,7 +31,7 @@ DFhackCExport command_result plugin_shutdown ( Core * c ) return CR_OK; } -DFhackCExport command_result df_notes (Core * c, vector & parameters) +command_result df_notes (Core * c, vector & parameters) { Console & con = c->con; c->Suspend(); diff --git a/plugins/devel/rawdump.cpp b/plugins/devel/rawdump.cpp index 595eb0a98..1dc7ebe42 100644 --- a/plugins/devel/rawdump.cpp +++ b/plugins/devel/rawdump.cpp @@ -16,8 +16,8 @@ bool final_flag = true; bool timering = false; uint64_t timeLast = 0; -DFhackCExport command_result rawdump_i (Core * c, vector & parameters); -DFhackCExport command_result rawdump_p (Core * c, vector & parameters); +command_result rawdump_i (Core * c, vector & parameters); +command_result rawdump_p (Core * c, vector & parameters); DFhackCExport const char * plugin_name ( void ) { @@ -37,7 +37,7 @@ DFhackCExport command_result plugin_shutdown ( Core * c ) return CR_OK; } -DFhackCExport command_result rawdump_i (Core * c, vector & parameters) +command_result rawdump_i (Core * c, vector & parameters) { int index = -1; Console & con = c->con; @@ -81,7 +81,7 @@ DFhackCExport command_result rawdump_i (Core * c, vector & parameters) return CR_OK; } -DFhackCExport command_result rawdump_p (Core * c, vector & parameters) +command_result rawdump_p (Core * c, vector & parameters) { int index = -1; Console & con = c->con; diff --git a/plugins/devel/tiles.cpp b/plugins/devel/tiles.cpp index d6ca4cbd1..219a9d28b 100644 --- a/plugins/devel/tiles.cpp +++ b/plugins/devel/tiles.cpp @@ -162,8 +162,8 @@ public: }; }; -DFhackCExport command_result df_tiles (Core * c, vector & parameters); -DFhackCExport command_result df_paint (Core * c, vector & parameters); +command_result df_tiles (Core * c, vector & parameters); +command_result df_paint (Core * c, vector & parameters); struct Settings { @@ -217,7 +217,7 @@ DFhackCExport command_result plugin_shutdown ( Core * c ) return CR_OK; } -DFhackCExport command_result df_tiles (Core * c, vector & parameters) +command_result df_tiles (Core * c, vector & parameters) { int32_t x,y,z; uint32_t x_max,y_max,z_max; diff --git a/plugins/devel/vectors.cpp b/plugins/devel/vectors.cpp index 777d661e7..4d8fde9d9 100644 --- a/plugins/devel/vectors.cpp +++ b/plugins/devel/vectors.cpp @@ -24,9 +24,9 @@ struct t_vecTriplet void * alloc_end; }; -DFhackCExport command_result df_vectors (Core * c, +command_result df_vectors (Core * c, vector & parameters); -DFhackCExport command_result df_clearvec (Core * c, +command_result df_clearvec (Core * c, vector & parameters); DFhackCExport const char * plugin_name ( void ) @@ -148,7 +148,7 @@ static void printVec(Console &con, const char* msg, t_vecTriplet *vec, msg, offset, pos, vec->start, length); } -DFhackCExport command_result df_vectors (Core * c, vector & parameters) +command_result df_vectors (Core * c, vector & parameters) { Console & con = c->con; @@ -270,7 +270,7 @@ static void clearUsage(Console &con) << std::endl; } -DFhackCExport command_result df_clearvec (Core * c, vector & parameters) +command_result df_clearvec (Core * c, vector & parameters) { Console & con = c->con; diff --git a/plugins/drybuckets.cpp b/plugins/drybuckets.cpp index f3cdacdc6..637c0dc98 100644 --- a/plugins/drybuckets.cpp +++ b/plugins/drybuckets.cpp @@ -17,7 +17,7 @@ using namespace df::enums; using df::global::world; -DFhackCExport command_result df_drybuckets (Core * c, vector & parameters) +command_result df_drybuckets (Core * c, vector & parameters) { if (!parameters.empty()) return CR_WRONG_USAGE; diff --git a/plugins/dwarfexport/dwarfexport.cpp b/plugins/dwarfexport/dwarfexport.cpp index 20d48f39a..877c75e2b 100644 --- a/plugins/dwarfexport/dwarfexport.cpp +++ b/plugins/dwarfexport/dwarfexport.cpp @@ -33,7 +33,7 @@ using df::global::world; // Here go all the command declarations... // mostly to allow having the mandatory stuff on top of the file and commands on the bottom -DFhackCExport command_result export_dwarves (Core * c, std::vector & parameters); +command_result export_dwarves (Core * c, std::vector & parameters); // A plugins must be able to return its name. This must correspond to the filename - export.plug.so or export.plug.dll DFhackCExport const char * plugin_name ( void ) @@ -155,7 +155,7 @@ static void export_dwarf(Core* c, df::unit* cre, ostream& out) { out << " " << endl; } -DFhackCExport command_result export_dwarves (Core * c, std::vector & parameters) +command_result export_dwarves (Core * c, std::vector & parameters) { string filename; if (parameters.size() == 1) { diff --git a/plugins/filltraffic.cpp b/plugins/filltraffic.cpp index b0261578d..3c1653ec3 100644 --- a/plugins/filltraffic.cpp +++ b/plugins/filltraffic.cpp @@ -18,21 +18,21 @@ using namespace DFHack; using namespace df::enums; //Function pointer type for whole-map tile checks. -typedef void (*checkTile)(DFHack::DFCoord, MapExtras::MapCache &); +typedef void (*checkTile)(DFCoord, MapExtras::MapCache &); //Forward Declarations for Commands -DFhackCExport command_result filltraffic(DFHack::Core * c, std::vector & params); -DFhackCExport command_result alltraffic(DFHack::Core * c, std::vector & params); +command_result filltraffic(Core * c, std::vector & params); +command_result alltraffic(Core * c, std::vector & params); //Forward Declarations for Utility Functions -DFhackCExport command_result setAllMatching(DFHack::Core * c, checkTile checkProc, - DFHack::DFCoord minCoord = DFHack::DFCoord(0, 0, 0), - DFHack::DFCoord maxCoord = DFHack::DFCoord(0xFFFF, 0xFFFF, 0xFFFF)); +command_result setAllMatching(Core * c, checkTile checkProc, +DFCoord minCoord = DFCoord(0, 0, 0), +DFCoord maxCoord = DFCoord(0xFFFF, 0xFFFF, 0xFFFF)); -void allHigh(DFHack::DFCoord coord, MapExtras::MapCache & map); -void allNormal(DFHack::DFCoord coord, MapExtras::MapCache & map); -void allLow(DFHack::DFCoord coord, MapExtras::MapCache & map); -void allRestricted(DFHack::DFCoord coord, MapExtras::MapCache & map); +void allHigh(DFCoord coord, MapExtras::MapCache & map); +void allNormal(DFCoord coord, MapExtras::MapCache & map); +void allLow(DFCoord coord, MapExtras::MapCache & map); +void allRestricted(DFCoord coord, MapExtras::MapCache & map); DFhackCExport const char * plugin_name ( void ) { @@ -78,7 +78,7 @@ DFhackCExport command_result plugin_shutdown ( Core * c ) return CR_OK; } -DFhackCExport command_result filltraffic(DFHack::Core * c, std::vector & params) +command_result filltraffic(Core * c, std::vector & params) { // HOTKEY COMMAND; CORE ALREADY SUSPENDED @@ -119,7 +119,7 @@ DFhackCExport command_result filltraffic(DFHack::Core * c, std::vectorgetGui(); + Gui * Gui = c->getGui(); if (!Maps::IsValid()) { c->con.printerr("Map is not available!\n"); @@ -137,7 +137,7 @@ DFhackCExport command_result filltraffic(DFHack::Core * c, std::vectorcon.printerr("This tile is a wall. Please select a passable tile.\n"); return CR_FAILURE; } - if(checkpit && DFHack::isOpenTerrain(tt)) + if(checkpit && isOpenTerrain(tt)) { c->con.printerr("This tile is a hole. Please select a passable tile.\n"); return CR_FAILURE; @@ -175,7 +175,7 @@ DFhackCExport command_result filltraffic(DFHack::Core * c, std::vectorcon.print("%d/%d/%d ... FILLING!\n", cx,cy,cz); //Naive four-way or six-way flood fill with possible tiles on a stack. - stack flood; + stack flood; flood.push(xy); while(!flood.empty()) @@ -188,8 +188,8 @@ DFhackCExport command_result filltraffic(DFHack::Core * c, std::vector 0) { - flood.push(DFHack::DFCoord(xy.x - 1, xy.y, xy.z)); + flood.push(DFCoord(xy.x - 1, xy.y, xy.z)); } if (xy.x < tx_max - 1) { - flood.push(DFHack::DFCoord(xy.x + 1, xy.y, xy.z)); + flood.push(DFCoord(xy.x + 1, xy.y, xy.z)); } if (xy.y > 0) { - flood.push(DFHack::DFCoord(xy.x, xy.y - 1, xy.z)); + flood.push(DFCoord(xy.x, xy.y - 1, xy.z)); } if (xy.y < ty_max - 1) { - flood.push(DFHack::DFCoord(xy.x, xy.y + 1, xy.z)); + flood.push(DFCoord(xy.x, xy.y + 1, xy.z)); } if (updown) { - if (xy.z > 0 && DFHack::LowPassable(tt)) + if (xy.z > 0 && LowPassable(tt)) { - flood.push(DFHack::DFCoord(xy.x, xy.y, xy.z - 1)); + flood.push(DFCoord(xy.x, xy.y, xy.z - 1)); } - if (xy.z < z_max && DFHack::HighPassable(tt)) + if (xy.z < z_max && HighPassable(tt)) { - flood.push(DFHack::DFCoord(xy.x, xy.y, xy.z + 1)); + flood.push(DFCoord(xy.x, xy.y, xy.z + 1)); } } @@ -241,9 +241,9 @@ DFhackCExport command_result filltraffic(DFHack::Core * c, std::vector & params) +command_result alltraffic(Core * c, std::vector & params) { - void (*proc)(DFHack::DFCoord, MapExtras::MapCache &) = allNormal; + void (*proc)(DFCoord, MapExtras::MapCache &) = allNormal; //Loop through parameters for(size_t i = 0; i < params.size();i++) @@ -274,13 +274,13 @@ DFhackCExport command_result alltraffic(DFHack::Core * c, std::vectorgetGui(); + Gui * Gui = c->getGui(); if (!Maps::IsValid()) { c->con.printerr("Map is not available!\n"); @@ -326,7 +326,7 @@ DFhackCExport command_result setAllMatching(DFHack::Core * c, checkTile checkPro { for(uint32_t z = minCoord.z; z <= maxCoord.z; z++) { - DFHack::DFCoord tile = DFHack::DFCoord(x, y, z); + DFCoord tile = DFCoord(x, y, z); checkProc(tile, MCache); } } @@ -338,27 +338,27 @@ DFhackCExport command_result setAllMatching(DFHack::Core * c, checkTile checkPro } //Unconditionally set map to target traffic type -void allHigh(DFHack::DFCoord coord, MapExtras::MapCache &map) +void allHigh(DFCoord coord, MapExtras::MapCache &map) { df::tile_designation des = map.designationAt(coord); des.bits.traffic = tile_traffic::High; map.setDesignationAt(coord, des); } -void allNormal(DFHack::DFCoord coord, MapExtras::MapCache &map) +void allNormal(DFCoord coord, MapExtras::MapCache &map) { df::tile_designation des = map.designationAt(coord); des.bits.traffic = tile_traffic::Normal; map.setDesignationAt(coord, des); } -void allLow(DFHack::DFCoord coord, MapExtras::MapCache &map) +void allLow(DFCoord coord, MapExtras::MapCache &map) { df::tile_designation des = map.designationAt(coord); des.bits.traffic = tile_traffic::Low; map.setDesignationAt(coord, des); } -void allRestricted(DFHack::DFCoord coord, MapExtras::MapCache &map) +void allRestricted(DFCoord coord, MapExtras::MapCache &map) { df::tile_designation des = map.designationAt(coord); des.bits.traffic = tile_traffic::Restricted; map.setDesignationAt(coord, des); -} \ No newline at end of file +} diff --git a/plugins/fixveins.cpp b/plugins/fixveins.cpp index 339bb773f..bb136f14b 100644 --- a/plugins/fixveins.cpp +++ b/plugins/fixveins.cpp @@ -35,7 +35,7 @@ bool setTileMaterial(df::tiletype &tile, const df::tiletype_material mat) return false; } -DFhackCExport command_result df_fixveins (Core * c, vector & parameters) +command_result df_fixveins (Core * c, vector & parameters) { if (parameters.size()) return CR_WRONG_USAGE; diff --git a/plugins/flows.cpp b/plugins/flows.cpp index 6827ba18d..d439bd9f9 100644 --- a/plugins/flows.cpp +++ b/plugins/flows.cpp @@ -17,7 +17,7 @@ using namespace df::enums; using df::global::world; -DFhackCExport command_result df_flows (Core * c, vector & parameters) +command_result df_flows (Core * c, vector & parameters) { CoreSuspender suspend(c); diff --git a/plugins/getplants.cpp b/plugins/getplants.cpp index 4281a8e99..5293a77a5 100644 --- a/plugins/getplants.cpp +++ b/plugins/getplants.cpp @@ -23,7 +23,7 @@ using namespace df::enums; using df::global::world; -DFhackCExport command_result df_getplants (Core * c, vector & parameters) +command_result df_getplants (Core * c, vector & parameters) { string plantMatStr = ""; set plantIDs; @@ -161,4 +161,4 @@ DFhackCExport command_result plugin_init ( Core * c, vector &com DFhackCExport command_result plugin_shutdown ( Core * c ) { return CR_OK; -} \ No newline at end of file +} diff --git a/plugins/initflags.cpp b/plugins/initflags.cpp index fd54b4883..900855e4e 100644 --- a/plugins/initflags.cpp +++ b/plugins/initflags.cpp @@ -14,8 +14,8 @@ using namespace df::enums; using df::global::d_init; -DFhackCExport command_result twaterlvl(Core * c, vector & parameters); -DFhackCExport command_result tidlers(Core * c, vector & parameters); +command_result twaterlvl(Core * c, vector & parameters); +command_result tidlers(Core * c, vector & parameters); DFhackCExport const char * plugin_name ( void ) { @@ -40,7 +40,7 @@ DFhackCExport command_result plugin_shutdown ( Core * c ) return CR_OK; } -DFhackCExport command_result twaterlvl(Core * c, vector & parameters) +command_result twaterlvl(Core * c, vector & parameters) { // HOTKEY COMMAND: CORE ALREADY SUSPENDED d_init->flags1.toggle(d_init_flags1::SHOW_FLOW_AMOUNTS); @@ -48,7 +48,7 @@ DFhackCExport command_result twaterlvl(Core * c, vector & parameters) return CR_OK; } -DFhackCExport command_result tidlers(Core * c, vector & parameters) +command_result tidlers(Core * c, vector & parameters) { // HOTKEY COMMAND: CORE ALREADY SUSPENDED d_init->idlers = ENUM_NEXT_ITEM(d_init_idlers, d_init->idlers); diff --git a/plugins/liquids.cpp b/plugins/liquids.cpp index e416fb9eb..c7cdf73aa 100644 --- a/plugins/liquids.cpp +++ b/plugins/liquids.cpp @@ -202,7 +202,7 @@ private: CommandHistory liquids_hist; -DFhackCExport command_result df_liquids (Core * c, vector & parameters); +command_result df_liquids (Core * c, vector & parameters); DFhackCExport const char * plugin_name ( void ) { @@ -223,7 +223,7 @@ DFhackCExport command_result plugin_shutdown ( Core * c ) return CR_OK; } -DFhackCExport command_result df_liquids (Core * c, vector & parameters) +command_result df_liquids (Core * c, vector & parameters) { int32_t x,y,z; diff --git a/plugins/mapexport/mapexport.cpp b/plugins/mapexport/mapexport.cpp index e486d324f..27794b645 100644 --- a/plugins/mapexport/mapexport.cpp +++ b/plugins/mapexport/mapexport.cpp @@ -23,7 +23,7 @@ using df::global::world; typedef std::vector PlantList; -DFhackCExport command_result mapexport (Core * c, std::vector & parameters); +command_result mapexport (Core * c, std::vector & parameters); DFhackCExport const char * plugin_name ( void ) { @@ -44,7 +44,7 @@ DFhackCExport command_result plugin_shutdown ( Core * c ) return CR_OK; } -DFhackCExport command_result mapexport (Core * c, std::vector & parameters) +command_result mapexport (Core * c, std::vector & parameters) { bool showHidden = false; diff --git a/plugins/mode.cpp b/plugins/mode.cpp index f318c3853..f5ec09ea8 100644 --- a/plugins/mode.cpp +++ b/plugins/mode.cpp @@ -12,7 +12,7 @@ using namespace std; using namespace DFHack; -DFhackCExport command_result mode (Core * c, vector & parameters); +command_result mode (Core * c, vector & parameters); DFhackCExport const char * plugin_name ( void ) { @@ -91,7 +91,7 @@ void printCurrentModes(t_gamemodes gm, Console & con) } } -DFhackCExport command_result mode (Core * c, vector & parameters) +command_result mode (Core * c, vector & parameters) { string command = ""; bool set = false; diff --git a/plugins/plants.cpp b/plugins/plants.cpp index 48a64bf6a..88407201d 100644 --- a/plugins/plants.cpp +++ b/plugins/plants.cpp @@ -20,9 +20,9 @@ using std::string; using namespace DFHack; using df::global::world; -DFhackCExport command_result df_grow (Core * c, vector & parameters); -DFhackCExport command_result df_immolate (Core * c, vector & parameters); -DFhackCExport command_result df_extirpate (Core * c, vector & parameters); +command_result df_grow (Core * c, vector & parameters); +command_result df_immolate (Core * c, vector & parameters); +command_result df_extirpate (Core * c, vector & parameters); DFhackCExport const char * plugin_name ( void ) { @@ -162,7 +162,7 @@ static command_result immolations (Core * c, do_what what, bool shrubs, bool tre return CR_OK; } -DFhackCExport command_result df_immolate (Core * c, vector & parameters) +command_result df_immolate (Core * c, vector & parameters) { bool shrubs = false, trees = false, help = false; if(getoptions(parameters,shrubs,trees,help)) @@ -176,7 +176,7 @@ DFhackCExport command_result df_immolate (Core * c, vector & parameters } } -DFhackCExport command_result df_extirpate (Core * c, vector & parameters) +command_result df_extirpate (Core * c, vector & parameters) { bool shrubs = false, trees = false, help = false; if(getoptions(parameters,shrubs,trees, help)) @@ -190,7 +190,7 @@ DFhackCExport command_result df_extirpate (Core * c, vector & parameter } } -DFhackCExport command_result df_grow (Core * c, vector & parameters) +command_result df_grow (Core * c, vector & parameters) { for(size_t i = 0; i < parameters.size();i++) { diff --git a/plugins/probe.cpp b/plugins/probe.cpp index 25294c300..2f7cbd83b 100644 --- a/plugins/probe.cpp +++ b/plugins/probe.cpp @@ -31,8 +31,8 @@ using namespace DFHack::Simple; using namespace df::enums; using df::global::world; -DFhackCExport command_result df_probe (Core * c, vector & parameters); -DFhackCExport command_result df_cprobe (Core * c, vector & parameters); +command_result df_probe (Core * c, vector & parameters); +command_result df_cprobe (Core * c, vector & parameters); DFhackCExport const char * plugin_name ( void ) { @@ -56,7 +56,7 @@ DFhackCExport command_result plugin_shutdown ( Core * c ) return CR_OK; } -DFhackCExport command_result df_cprobe (Core * c, vector & parameters) +command_result df_cprobe (Core * c, vector & parameters) { Console & con = c->con; CoreSuspender suspend(c); @@ -82,7 +82,7 @@ DFhackCExport command_result df_cprobe (Core * c, vector & parameters) return CR_OK; } -DFhackCExport command_result df_probe (Core * c, vector & parameters) +command_result df_probe (Core * c, vector & parameters) { //bool showBlock, showDesig, showOccup, showTile, showMisc; Console & con = c->con; diff --git a/plugins/prospector.cpp b/plugins/prospector.cpp index 4fc629abf..a84e49157 100644 --- a/plugins/prospector.cpp +++ b/plugins/prospector.cpp @@ -177,7 +177,7 @@ void printVeins(DFHack::Console & con, MatMap &mat_map, printMats(con, rest, world->raws.inorganics, show_value); } -DFhackCExport command_result prospector (Core * c, vector & parameters); +command_result prospector (Core * c, vector & parameters); DFhackCExport const char * plugin_name ( void ) { @@ -345,7 +345,7 @@ static command_result embark_prospector(DFHack::Core *c, df::viewscreen_choose_s return CR_OK; } -DFhackCExport command_result prospector (DFHack::Core * c, vector & parameters) +command_result prospector (DFHack::Core * c, vector & parameters) { bool showHidden = false; bool showPlants = true; diff --git a/plugins/qtplug/qtplug.cpp b/plugins/qtplug/qtplug.cpp index a33c28ad5..02bdfa092 100644 --- a/plugins/qtplug/qtplug.cpp +++ b/plugins/qtplug/qtplug.cpp @@ -23,7 +23,7 @@ static tthread::mutex * instance_mutex = 0; static bool running = false; static tthread::thread * QTThread; -DFhackCExport command_result runqt (Core * c, vector & parameters); +command_result runqt (Core * c, vector & parameters); DFhackCExport const char * plugin_name ( void ) { @@ -43,7 +43,7 @@ DFhackCExport command_result plugin_shutdown ( Core * c ) return CR_FAILURE; } -DFhackCExport command_result runqt (Core * c, vector & parameters) +command_result runqt (Core * c, vector & parameters) { instance_mutex->lock(); if(!running) diff --git a/plugins/regrass.cpp b/plugins/regrass.cpp index 8236a977f..3e66642e6 100644 --- a/plugins/regrass.cpp +++ b/plugins/regrass.cpp @@ -17,7 +17,7 @@ using namespace DFHack; using df::global::world; -DFhackCExport command_result df_regrass (Core * c, vector & parameters) +command_result df_regrass (Core * c, vector & parameters) { if (!parameters.empty()) return CR_WRONG_USAGE; @@ -67,4 +67,4 @@ DFhackCExport command_result plugin_init (Core *c, std::vector &c DFhackCExport command_result plugin_shutdown ( Core * c ) { return CR_OK; -} \ No newline at end of file +} diff --git a/plugins/reveal.cpp b/plugins/reveal.cpp index 739793ae6..0787f0113 100644 --- a/plugins/reveal.cpp +++ b/plugins/reveal.cpp @@ -58,11 +58,11 @@ enum revealstate revealstate revealed = NOT_REVEALED; -DFhackCExport command_result reveal(DFHack::Core * c, std::vector & params); -DFhackCExport command_result unreveal(DFHack::Core * c, std::vector & params); -DFhackCExport command_result revtoggle(DFHack::Core * c, std::vector & params); -DFhackCExport command_result revflood(DFHack::Core * c, std::vector & params); -DFhackCExport command_result nopause(DFHack::Core * c, std::vector & params); +command_result reveal(DFHack::Core * c, std::vector & params); +command_result unreveal(DFHack::Core * c, std::vector & params); +command_result revtoggle(DFHack::Core * c, std::vector & params); +command_result revflood(DFHack::Core * c, std::vector & params); +command_result nopause(DFHack::Core * c, std::vector & params); DFhackCExport const char * plugin_name ( void ) { @@ -124,7 +124,7 @@ command_result nopause (Core * c, std::vector & parameters) } -DFhackCExport command_result reveal(DFHack::Core * c, std::vector & params) +command_result reveal(DFHack::Core * c, std::vector & params) { bool no_hell = true; bool pause = true; @@ -215,7 +215,7 @@ DFhackCExport command_result reveal(DFHack::Core * c, std::vector & return CR_OK; } -DFhackCExport command_result unreveal(DFHack::Core * c, std::vector & params) +command_result unreveal(DFHack::Core * c, std::vector & params) { Console & con = c->con; for(size_t i = 0; i < params.size();i++) @@ -272,7 +272,7 @@ DFhackCExport command_result unreveal(DFHack::Core * c, std::vector return CR_OK; } -DFhackCExport command_result revtoggle (DFHack::Core * c, std::vector & params) +command_result revtoggle (DFHack::Core * c, std::vector & params) { for(size_t i = 0; i < params.size();i++) { @@ -292,7 +292,7 @@ DFhackCExport command_result revtoggle (DFHack::Core * c, std::vector & params) +command_result revflood(DFHack::Core * c, std::vector & params) { for(size_t i = 0; i < params.size();i++) { diff --git a/plugins/seedwatch.cpp b/plugins/seedwatch.cpp index 0639a308f..3d8f50e8e 100755 --- a/plugins/seedwatch.cpp +++ b/plugins/seedwatch.cpp @@ -97,7 +97,7 @@ string searchAbbreviations(string in) } }; -DFhackCExport command_result df_seedwatch(Core* pCore, vector& parameters) +command_result df_seedwatch(Core* pCore, vector& parameters) { Core& core = *pCore; if(!core.isValid()) @@ -348,4 +348,4 @@ DFhackCExport command_result plugin_onupdate(Core* pCore) DFhackCExport command_result plugin_shutdown(Core* pCore) { return CR_OK; -} \ No newline at end of file +} diff --git a/plugins/server/main.cpp b/plugins/server/main.cpp index 91dabc6f0..578da8b5d 100644 --- a/plugins/server/main.cpp +++ b/plugins/server/main.cpp @@ -10,7 +10,7 @@ using namespace DFHack; // Here go all the command declarations... // mostly to allow having the mandatory stuff on top of the file and commands on the bottom -DFhackCExport command_result server (Core * c, std::vector & parameters); +command_result server (Core * c, std::vector & parameters); // A plugins must be able to return its name. This must correspond to the filename - skeleton.plug.so or skeleton.plug.dll DFhackCExport const char * plugin_name ( void ) @@ -39,7 +39,7 @@ DFhackCExport command_result plugin_shutdown ( Core * c ) } // This is WRONG and STUPID. Never use this as an example! -DFhackCExport command_result server (Core * c, std::vector & parameters) +command_result server (Core * c, std::vector & parameters) { // It's nice to provide a 'help' option for your command. // It's also nice to print the same help if you get invalid options from the user instead of just acting strange @@ -79,4 +79,4 @@ DFhackCExport command_result server (Core * c, std::vector & param socket.send (reply); } return CR_OK; -} \ No newline at end of file +} diff --git a/plugins/showmood.cpp b/plugins/showmood.cpp index 6f677a4c5..4b31fee2e 100644 --- a/plugins/showmood.cpp +++ b/plugins/showmood.cpp @@ -27,7 +27,7 @@ using namespace df::enums; using df::global::world; -DFhackCExport command_result df_showmood (Core * c, vector & parameters) +command_result df_showmood (Core * c, vector & parameters) { if (!parameters.empty()) return CR_WRONG_USAGE; @@ -281,4 +281,4 @@ DFhackCExport command_result plugin_init (Core *c, std::vector &c DFhackCExport command_result plugin_shutdown ( Core * c ) { return CR_OK; -} \ No newline at end of file +} diff --git a/plugins/tiletypes.cpp b/plugins/tiletypes.cpp index 2c056e315..3d18cc771 100644 --- a/plugins/tiletypes.cpp +++ b/plugins/tiletypes.cpp @@ -633,7 +633,7 @@ public: CommandHistory tiletypes_hist; -DFhackCExport command_result df_tiletypes (Core * c, vector & parameters); +command_result df_tiletypes (Core * c, vector & parameters); DFhackCExport const char * plugin_name ( void ) { @@ -654,7 +654,7 @@ DFhackCExport command_result plugin_shutdown ( Core * c ) return CR_OK; } -DFhackCExport command_result df_tiletypes (Core * c, vector & parameters) +command_result df_tiletypes (Core * c, vector & parameters) { uint32_t x_max = 0, y_max = 0, z_max = 0; int32_t x = 0, y = 0, z = 0; diff --git a/plugins/tubefill.cpp b/plugins/tubefill.cpp index 0785b5aaf..8d098770a 100644 --- a/plugins/tubefill.cpp +++ b/plugins/tubefill.cpp @@ -18,7 +18,7 @@ using namespace DFHack::Simple; using namespace df::enums; using df::global::world; -DFhackCExport command_result tubefill(DFHack::Core * c, std::vector & params); +command_result tubefill(DFHack::Core * c, std::vector & params); DFhackCExport const char * plugin_name ( void ) { @@ -37,7 +37,7 @@ DFhackCExport command_result plugin_shutdown ( Core * c ) return CR_OK; } -DFhackCExport command_result tubefill(DFHack::Core * c, std::vector & params) +command_result tubefill(DFHack::Core * c, std::vector & params) { uint64_t count = 0; diff --git a/plugins/vdig.cpp b/plugins/vdig.cpp index 37f19547c..4e6e018d9 100644 --- a/plugins/vdig.cpp +++ b/plugins/vdig.cpp @@ -16,11 +16,11 @@ using std::stack; using namespace DFHack; using namespace df::enums; -DFhackCExport command_result vdig (Core * c, vector & parameters); -DFhackCExport command_result vdigx (Core * c, vector & parameters); -DFhackCExport command_result autodig (Core * c, vector & parameters); -DFhackCExport command_result expdig (Core * c, vector & parameters); -DFhackCExport command_result digcircle (Core *c, vector & parameters); +command_result vdig (Core * c, vector & parameters); +command_result vdigx (Core * c, vector & parameters); +command_result autodig (Core * c, vector & parameters); +command_result expdig (Core * c, vector & parameters); +command_result digcircle (Core *c, vector & parameters); DFhackCExport const char * plugin_name ( void ) @@ -180,7 +180,7 @@ bool lineY (MapExtras::MapCache & MCache, return true; }; -DFhackCExport command_result digcircle (Core * c, vector & parameters) +command_result digcircle (Core * c, vector & parameters) { static bool filled = false; static circle_what what = circle_set; @@ -777,7 +777,7 @@ bool stamp_pattern (uint32_t bx, uint32_t by, int z_level, return true; }; -DFhackCExport command_result expdig (Core * c, vector & parameters) +command_result expdig (Core * c, vector & parameters) { bool force_help = false; static explo_how how = EXPLO_NOTHING; @@ -954,7 +954,7 @@ DFhackCExport command_result expdig (Core * c, vector & parameters) return CR_OK; } -DFhackCExport command_result vdigx (Core * c, vector & parameters) +command_result vdigx (Core * c, vector & parameters) { // HOTKEY COMMAND: CORE ALREADY SUSPENDED vector lol; @@ -962,7 +962,7 @@ DFhackCExport command_result vdigx (Core * c, vector & parameters) return vdig(c,lol); } -DFhackCExport command_result vdig (Core * c, vector & parameters) +command_result vdig (Core * c, vector & parameters) { // HOTKEY COMMAND: CORE ALREADY SUSPENDED uint32_t x_max,y_max,z_max; @@ -1120,7 +1120,7 @@ DFhackCExport command_result vdig (Core * c, vector & parameters) return CR_OK; } -DFhackCExport command_result autodig (Core * c, vector & parameters) +command_result autodig (Core * c, vector & parameters) { return CR_NOT_IMPLEMENTED; } diff --git a/plugins/versionosd.cpp b/plugins/versionosd.cpp index f3e63e8c3..5fa94c962 100644 --- a/plugins/versionosd.cpp +++ b/plugins/versionosd.cpp @@ -15,7 +15,7 @@ using namespace std; #include "modules/Gui.h" using namespace DFHack; -DFhackCExport command_result df_versionosd (Core * c, vector & parameters); +command_result df_versionosd (Core * c, vector & parameters); static DFSDL_Surface* (*_IMG_LoadPNG_RW)(void* src) = 0; static vPtr (*_SDL_RWFromFile)(const char* file, const char *mode) = 0; static int (*_SDL_SetAlpha)(vPtr surface, uint32_t flag, uint8_t alpha) = 0; @@ -117,7 +117,7 @@ DFhackCExport command_result plugin_shutdown ( Core * c ) return CR_OK; } -DFhackCExport command_result df_versionosd (Core * c, vector & parameters) +command_result df_versionosd (Core * c, vector & parameters) { On = !On; c->Suspend(); diff --git a/plugins/weather.cpp b/plugins/weather.cpp index 9d88ac19d..97285a126 100644 --- a/plugins/weather.cpp +++ b/plugins/weather.cpp @@ -13,7 +13,7 @@ using namespace DFHack; bool locked = false; unsigned char locked_data[25]; -DFhackCExport command_result weather (Core * c, vector & parameters); +command_result weather (Core * c, vector & parameters); DFhackCExport const char * plugin_name ( void ) { @@ -40,7 +40,7 @@ DFhackCExport command_result plugin_shutdown ( Core * c ) return CR_OK; } -DFhackCExport command_result weather (Core * c, vector & parameters) +command_result weather (Core * c, vector & parameters) { Console & con = c->con; bool lock = false;