| 105 | } |
| 106 | |
| 107 | void Checker::queue_globals() |
| 108 | { |
| 109 | auto fields = df::global::_identity.getFields(); |
| 110 | for (auto field = fields; field->mode != struct_field_info::END; field++) |
| 111 | { |
| 112 | if (!field->offset) |
| 113 | { |
| 114 | UNEXPECTED; |
| 115 | continue; |
| 116 | } |
| 117 | |
| 118 | // offset is the position of the DFHack pointer to this global. |
| 119 | auto ptr = *reinterpret_cast<const void **>(field->offset); |
| 120 | |
| 121 | QueueItem item(fmt::format("df.global.{}", field->name), ptr); |
| 122 | CheckedStructure cs(field); |
| 123 | |
| 124 | if (!ptr) |
| 125 | { |
| 126 | FAIL("unknown global address"); |
| 127 | continue; |
| 128 | } |
| 129 | |
| 130 | if (!strcmp(field->name, "enabler")) |
| 131 | { |
| 132 | // don't care about libgraphics as we have the source code |
| 133 | continue; |
| 134 | } |
| 135 | |
| 136 | queue_item(item, cs); |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | bool Checker::process_queue() |
| 141 | { |