2018-07-07 04:27:29 -06:00
|
|
|
#include "Core.h"
|
2011-12-24 03:51:58 -07:00
|
|
|
#include "Internal.h"
|
2011-12-31 04:48:42 -07:00
|
|
|
#include "DataDefs.h"
|
|
|
|
#include "MiscUtils.h"
|
2012-02-11 05:27:12 -07:00
|
|
|
#include "VersionInfo.h"
|
2011-12-24 05:22:10 -07:00
|
|
|
|
2011-12-31 04:48:42 -07:00
|
|
|
#include "df/world.h"
|
|
|
|
#include "df/world_data.h"
|
|
|
|
#include "df/ui.h"
|
2011-12-24 05:22:10 -07:00
|
|
|
|
2012-03-20 03:56:29 -06:00
|
|
|
#include "DataIdentity.h"
|
|
|
|
|
2011-12-24 05:22:10 -07:00
|
|
|
namespace {
|
|
|
|
template<class T>
|
2020-04-18 19:39:57 -06:00
|
|
|
inline T *_toptr(T &r) { return &r; }
|
2011-12-24 05:22:10 -07:00
|
|
|
template<class T>
|
2020-04-18 19:39:57 -06:00
|
|
|
inline T *_toptr(T *&p) { return p; }
|
2011-12-24 05:22:10 -07:00
|
|
|
}
|
2020-04-18 19:39:57 -06:00
|
|
|
#define _fieldptr(ptr, fn) (ptr) ? _toptr((ptr)->fn) : NULL
|
2011-12-24 03:51:58 -07:00
|
|
|
|
2012-02-11 05:27:12 -07:00
|
|
|
#define INIT_GLOBAL_FUNCTION_PREFIX \
|
2018-07-08 16:50:14 -06:00
|
|
|
DFHack::VersionInfo *global_table_ = DFHack::Core::getInstance().vinfo.get(); \
|
2012-02-11 05:27:12 -07:00
|
|
|
void * tmp_;
|
|
|
|
|
|
|
|
#define INIT_GLOBAL_FUNCTION_ITEM(type,name) \
|
2012-02-11 10:48:17 -07:00
|
|
|
if (global_table_->getAddress(#name,tmp_)) name = (type*)tmp_;
|
2012-02-11 05:27:12 -07:00
|
|
|
|
2012-03-19 06:59:11 -06:00
|
|
|
#define TID(type) (&identity_traits< type >::identity)
|
|
|
|
|
2011-12-24 03:51:58 -07:00
|
|
|
// Instantiate all the static objects
|
2011-12-31 04:48:42 -07:00
|
|
|
#include "df/static.inc"
|
|
|
|
#include "df/static.enums.inc"
|