diff --git a/tools/playground/test.cpp b/tools/playground/test.cpp index e62b35d2a..b67608f9a 100644 --- a/tools/playground/test.cpp +++ b/tools/playground/test.cpp @@ -8,10 +8,32 @@ using namespace std; #include +#include +#include +#include +#include using namespace DFHack; int main (int numargs, const char ** args) { + printf("From C: "); + DFHackObject* cman = ContextManager_Alloc("Memory.xml"); + DFHackObject* context = ContextManager_getSingleContext(cman); + if(context) + { + Context_Attach(context); + DFHackObject * maps = Context_getMaps(context); + if(maps) + { + Maps_Start(maps); + uint32_t x,y,z; + Maps_getSize(maps, &x, &y, &z); + printf("Map size: %d, %d, %d\n", x,y,z); + } + } + ContextManager_Free(cman); + + cout << "From C++:"; DFHack::ContextManager DFMgr("Memory.xml"); DFHack::Context * DF; try @@ -29,6 +51,11 @@ int main (int numargs, const char ** args) } // DO STUFF HERE + Maps * m = DF->getMaps(); + m->Start(); + uint32_t x,y,z; + m->getSize(x,y,z); + cout << "Map size " << x << ", "<< y << ", " << z << endl; #ifndef LINUX_BUILD cout << "Done. Press any key to continue" << endl;