cursor and window coords reading and writing (only for 40d16 on windows right now)
parent
e8e3f9e794
commit
30d8a015fd
@ -0,0 +1,45 @@
|
||||
// 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");
|
||||
if(!DF.Attach())
|
||||
{
|
||||
cerr << "DF not found" << endl;
|
||||
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;
|
||||
}
|
||||
else
|
||||
{
|
||||
cerr << "cursor and window parameters are unsupported on your version of DF" << endl;
|
||||
}
|
||||
|
||||
if(!DF.Detach())
|
||||
{
|
||||
cerr << "Can't detach from DF" << endl;
|
||||
return 1;
|
||||
}
|
||||
#ifndef LINUX_BUILD
|
||||
cout << "Done. Press any key to continue" << endl;
|
||||
cin.ignore();
|
||||
#endif
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue