Merge branch 'master' into purge

Conflicts:
	library/DataDefs.cpp
develop
Petr Mrázek 2012-02-11 18:48:17 +01:00
commit 8527547cbe
12 changed files with 20 additions and 184 deletions

@ -1,123 +0,0 @@
<?xml version="1.0"?>
<DFHack>
.,:rsr,
:2;,;r2A@@5
@2::s5A#@@@ @r. .
sd;:riXA#@@ :@@@Gir;;AS9
Bs::sS3A#@2 @@#AhXirsS#;
iHrLr5d#@@@ .@#95sr;;rie
i*' `*@3 @@A2sr;:;r#5
:..:rll: @@A5sr::r3@
@Hr;iZ#@@@@ `:rr;;;;:
S@r.;i2#@@@ @s. ..
@2::ri2A@@# B@G2ir:...5i
:@r,r3X##@@ @G5sr:..,:A
.@Ar;;rSB@@# H#2sr;,..,is
.' `* ,@ASs;:..,:B
;rr;:,..,:.
`'''
W I N D O W S
<Version name="v0.31.25 SDL" os="windows">
<PETimeStamp value="0x4D90764F" />
<!-- .data -->
<Address key="control_mode" value="0x8A4814" />
<Address key="game_mode" value="0x8A4818" />
<Address key='cursor' value='0xb347f0'/>
<Address key='selection_rect' value='0xb347fc'/>
<Address name="window_x" value="0xC20984" />
<Address name="window_y" value="0xC4EBA0" />
<Address name="window_z" value="0xC4EB7C" />
<!-- .bss -->
<Address key='world' value='0x16b0a58'/>
<Address key="pause_state" value="0x125C7C9" />
<Address key='ui' value='0x14ee7e0'/>
<Address key='gview' value='0x14f6070'/>
<Address key='init' value='0x184ae58'/>
<Address key='d_init' value='0x1848350'/>
<Address key='ui_sidebar_menus' value='0x1848648'/>
<Address key='ui_build_selector' value='0x1849e88'/>
<Address key='ui_look_list' value='0x185c104'/>
<Address key='ui_look_cursor' value='0xedeb98'/>
<Address key='ui_workshop_job_cursor' value='0x14ec79c'/>
<Address key='ui_workshop_in_add' value='0xeb0992'/>
<!--<Address key="screen_tiles_pointer" />-->
<Address key='job_next_id' value='0xe18290'/>
<Address key='ui_building_item_cursor' value='0xef7264'/>
<Address key='ui_selected_unit' value='0xef2430'/>
<Address key='ui_unit_view_mode' value='0xec4a5c'/>
<Address key="current_weather" value="0x125C7A0" />
<Address key='cur_year' value='0xef7268'/>
<Address key='cur_year_tick' value='0xec5170'/>
<Address key='gps' value='0xb34d10'/>
</Version>
.-"""-.
' \
|,. ,-. | _________________________
|()L( ()| | \ \
|,' `".| | /_ Argh !!! \
|.___.',| ` \________________________\
.j `--"' ` `.
/ ' ' \
/ / ` `.
/ / ` .
/ / l |
. , L I N U X | |
,"`. .| |
_.' ``. | `..-'l
| `.`, | `.
| `. __.j )
|__ |--""___| ,-'
`"--...,+"""" `._,.-'
<!-- Windows logo by Microsoft -->
<!-- Tux logo by the Linux guys :) -->
<Version name="v0.31.25 linux" os="linux" >
<MD5 value="fc15065c4d1977ca019c6dad220413d1" />
<!--<MD5 value="add more here if required">-->
<!-- .data -->
<Address key='cursor' value='0x8c3de60'/>
<Address key='selection_rect' value='0x8c3de70'/>
<Address key="control_mode" value="0x8c3de90" />
<Address key="game_mode" value="0x8c3dea0" />
<Address key="window_x" value="0x8dfaa98" />
<Address key="window_y" value="0x8dfaa9c" />
<Address key="window_z" value="0x8dfaaa0" />
<!-- .bss -->
<Address key='world' value='0x93f77a0'/>
<Address key="pause_state" value="0x93f06f0" />
<Address key='ui' value='0x93f0780'/>
<Address key='gview' value='0x8c3e900'/>
<Address key='init' value='0x959c2a0'/>
<Address key='d_init' value='0x959d340'/>
<Address key='ui_sidebar_menus' value='0x958aa40'/>
<Address key='ui_build_selector' value='0x8df9b20'/>
<Address key='ui_look_list' value='0x961d840'/>
<Address key='ui_look_cursor' value='0x93f06dc'/>
<Address key='ui_workshop_job_cursor' value='0x93f0644'/>
<Address key='ui_workshop_in_add' value='0x93f0651'/>
<!-- maybe, untested for a looong time, possibly not even needed -->
<Address key="screen_tiles_pointer" value="0x958c17c" />
<Address key='job_next_id' value='0x961d940'/>
<Address key='ui_building_item_cursor' value='0x93f0648'/>
<Address key='ui_selected_unit' value='0x93f06d0'/>
<Address key='ui_unit_view_mode' value='0x93f06d8'/>
<Address key="current_weather" value="0x0x93f05e4" />
<Address key='cur_year' value='0x93f0600'/>
<Address key='cur_year_tick' value='0x93f0620'/>
<Address key='gps' value='0x8c3e000'/>
</Version>
</DFHack>

@ -651,7 +651,7 @@ bool Core::Init()
*/
// initialize data defs
virtual_identity::Init(this);
InitDataDefGlobals(this);
df::global::InitGlobals();
// create mutex for syncing with interactive tasks
StackMutex = new mutex();

@ -208,22 +208,3 @@ int DFHack::findBitfieldField(const std::string &name, int size, const bitfield_
return -1;
}
#define SIMPLE_GLOBAL(name,tname) \
tname *df::global::name = NULL;
#define GLOBAL(name,tname) SIMPLE_GLOBAL(name,df::tname)
DF_KNOWN_GLOBALS
#undef GLOBAL
#undef SIMPLE_GLOBAL
void DFHack::InitDataDefGlobals(Core *core) {
VersionInfo *vinfo = core->vinfo;
void * tmp;
#define SIMPLE_GLOBAL(name,tname) \
if (vinfo->getAddress(#name,tmp)) df::global::name = (tname*)tmp;
#define GLOBAL(name,tname) SIMPLE_GLOBAL(name,df::tname)
DF_KNOWN_GLOBALS
#undef GLOBAL
#undef SIMPLE_GLOBAL
}

@ -1,6 +1,7 @@
#include "Internal.h"
#include "DataDefs.h"
#include "MiscUtils.h"
#include "VersionInfo.h"
#include "df/world.h"
#include "df/world_data.h"
@ -13,6 +14,13 @@ namespace {
inline T &_toref(T *&p) { return *p; }
}
#define INIT_GLOBAL_FUNCTION_PREFIX \
DFHack::VersionInfo *global_table_ = DFHack::Core::getInstance().vinfo; \
void * tmp_;
#define INIT_GLOBAL_FUNCTION_ITEM(type,name) \
if (global_table_->getAddress(#name,tmp_)) name = (type*)tmp_;
// Instantiate all the static objects
#include "df/static.inc"
#include "df/static.enums.inc"

@ -122,7 +122,7 @@ void VersionInfoFactory::ParseVersion (TiXmlElement* entry, VersionInfo* mem)
{
const char *cstr_key = pMemEntry->Attribute("key");
if(!cstr_key)
throw Error::MemoryXmlUnderspecifiedEntry(cstr_key);
throw Error::MemoryXmlUnderspecifiedEntry(cstr_name);
const char *cstr_value = pMemEntry->Attribute("value");
if(!cstr_value)
throw Error::MemoryXmlUnderspecifiedEntry(cstr_name);

@ -237,38 +237,8 @@ namespace df
#define FOR_ENUM_ITEMS(enum,iter) \
for(df::enum iter = ENUM_FIRST_ITEM(enum); iter <= ENUM_LAST_ITEM(enum); iter = df::enum(1+int(iter)))
namespace df {
#define DF_KNOWN_GLOBALS \
GLOBAL(cursor,cursor) \
GLOBAL(selection_rect,selection_rect) \
GLOBAL(world,world) \
GLOBAL(ui,ui) \
GLOBAL(gview,interface) \
GLOBAL(init,init) \
GLOBAL(d_init,d_init) \
SIMPLE_GLOBAL(job_next_id,int) \
SIMPLE_GLOBAL(ui_look_cursor,int) \
SIMPLE_GLOBAL(ui_workshop_job_cursor,int) \
SIMPLE_GLOBAL(ui_building_item_cursor,int) \
SIMPLE_GLOBAL(ui_workshop_in_add,bool) \
SIMPLE_GLOBAL(ui_selected_unit,int) \
SIMPLE_GLOBAL(cur_year,int) \
SIMPLE_GLOBAL(cur_year_tick,int) \
GLOBAL(ui_sidebar_menus,ui_sidebar_menus) \
GLOBAL(ui_build_selector,ui_build_selector) \
GLOBAL(ui_look_list,ui_look_list) \
GLOBAL(ui_unit_view_mode, ui_unit_view_mode) \
GLOBAL(gps, graphic) \
#define SIMPLE_GLOBAL(name,tname) \
namespace global { extern DFHACK_EXPORT tname *name; }
#define GLOBAL(name,tname) \
struct tname; SIMPLE_GLOBAL(name,tname)
DF_KNOWN_GLOBALS
#undef GLOBAL
#undef SIMPLE_GLOBAL
}
// Global object pointers
#include "df/global_objects.h"
// A couple of headers that have to be included at once
#include "df/coord2d.h"

@ -46,7 +46,7 @@ namespace Constructions
struct t_construction {
df::coord pos;
df::item_type item_type;
int16_t unk;
int16_t item_subtype;
int16_t mat_type;
int32_t mat_index;
df::construction_flags flags;

@ -49,8 +49,8 @@ struct t_engraving {
df::coord pos;
df::engraving_flags flags;
int8_t tile;
int32_t type;
int16_t subtype;
int32_t art_id;
int16_t art_subid;
df::item_quality quality;
// Pointer to original object, in case you want to modify it
df::engraving *origin;

@ -49,7 +49,7 @@ typedef uint8_t t_exclusionType;
const unsigned int seedLimit = 400; // a limit on the limits which can be placed on seeds
const t_itemSubtype organicSubtype = -1; // seems to fixed
const t_exclusionType cookingExclusion = 1; // seems to be fixed
const t_itemType limitType = 0; // used to store limit as an entry in the exclusion list. 0 = BAR
const df::enums::item_type::item_type limitType = df::enums::item_type::BAR; // used to store limit as an entry in the exclusion list. 0 = BAR
const t_itemSubtype limitSubtype = 0; // used to store limit as an entry in the exclusion list
const t_exclusionType limitExclusion = 4; // used to store limit as an entry in the exclusion list

@ -67,7 +67,7 @@ bool Constructions::copyConstruction(const int32_t index, t_construction &out)
out.pos = out.origin->pos;
out.item_type = out.origin->item_type;
out.unk = out.origin->anon_1;
out.item_subtype = out.origin->item_subtype;
out.mat_type = out.origin->mat_type;
out.mat_index = out.origin->mat_index;
out.flags = out.origin->flags;

@ -72,8 +72,8 @@ bool Engravings::copyEngraving(const int32_t index, t_engraving &out)
out.pos = out.origin->pos;
out.flags = out.origin->flags;
out.tile = out.origin->tile;
out.type = out.origin->type;
out.subtype = out.origin->subtype;
out.art_id = out.origin->art_id;
out.art_subid = out.origin->art_subid;
out.quality = out.origin->quality;
return true;
}

@ -1 +1 @@
Subproject commit 032d4fea9c6b821d258c8a413e56efe274d9572c
Subproject commit 3b20ecfbfcb7b801dbe83b1c22f183ca6085af9e