2009-11-11 18:39:43 -07:00
|
|
|
// Just show some position data
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
#include <climits>
|
|
|
|
#include <integers.h>
|
|
|
|
#include <vector>
|
|
|
|
#include <ctime>
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
#include <DFTypes.h>
|
|
|
|
#include <DFHackAPI.h>
|
|
|
|
|
|
|
|
int main (void)
|
|
|
|
{
|
|
|
|
DFHack::API DF("Memory.xml");
|
2010-03-26 06:01:46 -06:00
|
|
|
try
|
2009-11-11 18:39:43 -07:00
|
|
|
{
|
2010-03-26 06:01:46 -06:00
|
|
|
DF.Attach();
|
|
|
|
}
|
|
|
|
catch (exception& e)
|
|
|
|
{
|
|
|
|
cerr << e.what() << endl;
|
|
|
|
#ifndef LINUX_BUILD
|
|
|
|
cin.ignore();
|
|
|
|
#endif
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (DF.InitViewAndCursor())
|
|
|
|
{
|
|
|
|
int32_t x,y,z;
|
|
|
|
if(DF.getViewCoords(x,y,z))
|
|
|
|
cout << "view coords: " << x << "/" << y << "/" << z << endl;
|
|
|
|
if(DF.getCursorCoords(x,y,z))
|
|
|
|
cout << "cursor coords: " << x << "/" << y << "/" << z << endl;
|
2009-11-17 20:35:43 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-03-26 06:01:46 -06:00
|
|
|
cerr << "cursor and window parameters are unsupported on your version of DF" << endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(DF.InitViewSize())
|
|
|
|
{
|
|
|
|
int32_t width,height;
|
|
|
|
if(DF.getWindowSize(width,height))
|
|
|
|
cout << "window size : " << width << " " << height << endl;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
cerr << "view size is unsupported on your version of DF" << endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!DF.Detach())
|
|
|
|
{
|
|
|
|
cerr << "Can't detach from DF" << endl;
|
2009-11-11 18:39:43 -07:00
|
|
|
}
|
2010-03-26 06:01:46 -06:00
|
|
|
|
2009-11-11 18:39:43 -07:00
|
|
|
#ifndef LINUX_BUILD
|
2010-03-26 06:01:46 -06:00
|
|
|
cout << "Done. Press any key to continue" << endl;
|
|
|
|
cin.ignore();
|
2009-11-11 18:39:43 -07:00
|
|
|
#endif
|
|
|
|
return 0;
|
2009-12-13 14:03:19 -07:00
|
|
|
}
|