Windows fixes

develop
Petr Mrázek 2010-04-10 05:48:50 +02:00
parent 887f1942cc
commit e2a7d9e639
4 changed files with 8 additions and 8 deletions

@ -181,7 +181,7 @@ namespace DFHack
DFWindow * getWindow(); DFWindow * getWindow();
int getPID(); int getPID();
// get module index by name and version. bool 1 = error // get module index by name and version. bool 1 = error
bool getModuleIndex (const char * name, const uint32_t version, uint32_t & OUTPUT) {return false;}; bool getModuleIndex (const char * name, const uint32_t version, uint32_t & OUTPUT) { OUTPUT=0; return false;};
// get the SHM start if available // get the SHM start if available
char * getSHMStart (void){return 0;}; char * getSHMStart (void){return 0;};
// set a SHM command and wait for a response // set a SHM command and wait for a response
@ -306,7 +306,7 @@ namespace DFHack
DFWindow * getWindow(); DFWindow * getWindow();
int getPID(); int getPID();
// get module index by name and version. bool 1 = error // get module index by name and version. bool 1 = error
bool getModuleIndex (const char * name, const uint32_t version, uint32_t & OUTPUT) {return false;}; bool getModuleIndex (const char * name, const uint32_t version, uint32_t & OUTPUT) {OUTPUT=0; return false;};
// get the SHM start if available // get the SHM start if available
char * getSHMStart (void){return 0;}; char * getSHMStart (void){return 0;};
bool SetAndWait (uint32_t state){return false;}; bool SetAndWait (uint32_t state){return false;};

@ -14,7 +14,7 @@ namespace DFHack
constr_boulder = 4, constr_boulder = 4,
constr_logs = 5, constr_logs = 5,
}; };
#pragma pack(1)
struct t_construction struct t_construction
{ {
//0 //0
@ -22,7 +22,7 @@ namespace DFHack
uint16_t y; uint16_t y;
// 4 // 4
uint16_t z; uint16_t z;
e_construction_base type :16; // 4 = 'rough' uint16_t form; // e_construction_base
// 8 // 8
uint16_t unk_8; // = -1 in many cases uint16_t unk_8; // = -1 in many cases
uint16_t mat_type; uint16_t mat_type;

@ -60,7 +60,7 @@ int main (int numargs, const char ** args)
{ {
printf("Construction %d/%d/%d @ 0x%x\n", con.x, con.y, con.z,con.origin); printf("Construction %d/%d/%d @ 0x%x\n", con.x, con.y, con.z,con.origin);
// inorganic stuff - we can recognize that // inorganic stuff - we can recognize that
printf("Material: form %d, type %d, index %d\n",con.type, con.mat_type, con.mat_idx); printf("Material: form %d, type %d, index %d\n",con.form, con.mat_type, con.mat_idx);
string matstr = "unknown"; string matstr = "unknown";
if(con.mat_type == 0) if(con.mat_type == 0)
{ {
@ -68,7 +68,7 @@ int main (int numargs, const char ** args)
matstr = inorganics[con.mat_idx].id; matstr = inorganics[con.mat_idx].id;
else matstr = "inorganic"; else matstr = "inorganic";
} }
switch(con.type) switch(con.form)
{ {
case constr_bar: case constr_bar:
printf("It is made of %s bars!\n",matstr.c_str()); printf("It is made of %s bars!\n",matstr.c_str());

@ -56,8 +56,8 @@ int main (int numargs, const char ** args)
if(cx == con.x && cy == con.y && cz == con.z) if(cx == con.x && cy == con.y && cz == con.z)
{ {
printf("Construction %d/%d/%d @ 0x%x - Material %d %d\n", con.x, con.y, con.z,con.origin, con.mat_type, con.mat_idx); printf("Construction %d/%d/%d @ 0x%x - Material %d %d\n", con.x, con.y, con.z,con.origin, con.mat_type, con.mat_idx);
printf("Material form: %d ", con.type); printf("Material form: %d ", con.form);
if(con.type == 4) if(con.form == 4)
{ {
printf("It is rough."); printf("It is rough.");
} }