| 189 | } |
| 190 | |
| 191 | void VarsToGUI(VM &vm) { |
| 192 | auto DumpVars = [&](bool constants) { |
| 193 | for (uint i = 0; i < vm.bcf->specidents()->size(); i++) { |
| 194 | auto &val = vm.vars[i]; |
| 195 | auto sid = vm.bcf->specidents()->Get(i); |
| 196 | auto id = vm.bcf->idents()->Get(sid->ididx()); |
| 197 | if (!id->global() || id->readonly() != constants) continue; |
| 198 | auto name = id->name()->string_view(); |
| 199 | auto &ti = vm.GetVarTypeInfo(i); |
| 200 | #if RTT_ENABLED |
| 201 | if (ti.t != val.type) continue; // Likely uninitialized. |
| 202 | #endif |
| 203 | ValToGUI(vm, &val, ti, name, false); |
| 204 | if (IsStruct(ti.t)) i += ti.len - 1; |
| 205 | } |
| 206 | }; |
| 207 | DumpVars(false); |
| 208 | if (ImGui::TreeNodeEx("Constants", 0)) { |
| 209 | DumpVars(true); |
| 210 | ImGui::TreePop(); |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | void EngineStatsGUI() { |
| 215 | auto &ft = SDLGetFrameTimeLog(); |