diff options
| author | Alexander Gavrilov | 2012-02-11 16:27:12 +0400 |
|---|---|---|
| committer | Alexander Gavrilov | 2012-02-11 16:27:12 +0400 |
| commit | f469fab1e6e419ff26655bc3fe9868653dc0f0f0 (patch) | |
| tree | 0fee7b715fc966bfdd897d0f45a64b1c2b431cd4 /library/DataStatics.cpp | |
| parent | 952f621ee272f321939ac8161b9f566496593e2a (diff) | |
| download | dfhack-f469fab1e6e419ff26655bc3fe9868653dc0f0f0.tar.gz dfhack-f469fab1e6e419ff26655bc3fe9868653dc0f0f0.tar.bz2 dfhack-f469fab1e6e419ff26655bc3fe9868653dc0f0f0.tar.xz | |
Use globals defined by the latest codegen.
Diffstat (limited to 'library/DataStatics.cpp')
| -rw-r--r-- | library/DataStatics.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/library/DataStatics.cpp b/library/DataStatics.cpp index f47c0fe0..63eb596e 100644 --- a/library/DataStatics.cpp +++ b/library/DataStatics.cpp @@ -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::OffsetGroup *global_table_ = DFHack::Core::getInstance().vinfo->getGroup("global"); \ + void * tmp_; + +#define INIT_GLOBAL_FUNCTION_ITEM(type,name) \ + if (global_table_->getSafeAddress(#name,tmp_)) name = (type*)tmp_; + // Instantiate all the static objects #include "df/static.inc" #include "df/static.enums.inc" |
