fix base_display_addr
This commit is contained in:
parent
bc1efe5056
commit
e22133d3f8
3 changed files with 6 additions and 8 deletions
|
@ -31,7 +31,7 @@ internal
|
||||||
u32 mem_edit_bg_color_fn(const u8 *, u64 off, void *user_data)
|
u32 mem_edit_bg_color_fn(const u8 *, u64 off, void *user_data)
|
||||||
{
|
{
|
||||||
App_State *app = reinterpret_cast<App_State *>(user_data);
|
App_State *app = reinterpret_cast<App_State *>(user_data);
|
||||||
off += app->viewer.base_display_addr;
|
off += app->base_display_addr;
|
||||||
|
|
||||||
i64 hilite_cluster = app->viewer.highlight_cluster ? app->viewer.highlighted_cluster : -1;
|
i64 hilite_cluster = app->viewer.highlight_cluster ? app->viewer.highlighted_cluster : -1;
|
||||||
Section section = find_section(*app, off, hilite_cluster);
|
Section section = find_section(*app, off, hilite_cluster);
|
||||||
|
@ -194,11 +194,11 @@ void update_and_render(Arena *arena, App_State &app, f32 delta_time_ms)
|
||||||
|
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
|
|
||||||
assert(app.viewer.base_display_addr < app.inspected_file.size);
|
assert(app.base_display_addr < app.inspected_file.size);
|
||||||
void *content = app.inspected_file.mem + app.viewer.base_display_addr;
|
void *content = app.inspected_file.mem + app.base_display_addr;
|
||||||
u64 content_size = app.inspected_file.size - app.viewer.base_display_addr;
|
u64 content_size = app.inspected_file.size - app.base_display_addr;
|
||||||
app.last_pinfo = &invalid_pinfo;
|
app.last_pinfo = &invalid_pinfo;
|
||||||
app.viewer.mem_edit.DrawContents(content, content_size, app.viewer.base_display_addr);
|
app.viewer.mem_edit.DrawContents(content, content_size, app.base_display_addr);
|
||||||
|
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGuiColorEditFlags flags = ImGuiColorEditFlags_NoInputs|ImGuiColorEditFlags_NoLabel;
|
ImGuiColorEditFlags flags = ImGuiColorEditFlags_NoInputs|ImGuiColorEditFlags_NoLabel;
|
||||||
|
|
|
@ -10,8 +10,6 @@ struct Viewer {
|
||||||
f32 col_highlight[3];
|
f32 col_highlight[3];
|
||||||
f32 col_page_start[3];
|
f32 col_page_start[3];
|
||||||
|
|
||||||
u64 base_display_addr;
|
|
||||||
|
|
||||||
b8 highlight_cluster;
|
b8 highlight_cluster;
|
||||||
u64 highlighted_cluster;
|
u64 highlighted_cluster;
|
||||||
|
|
||||||
|
|
|
@ -115,6 +115,7 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
app.ntpl_name = args.ntpl_name;
|
app.ntpl_name = args.ntpl_name;
|
||||||
|
app.base_display_addr = args.start_addr;
|
||||||
app.tfile_data = get_tfile_data(app.inspected_file);
|
app.tfile_data = get_tfile_data(app.inspected_file);
|
||||||
app.rndata = get_rntuple_data(arena, app.inspected_file, app.ntpl_name);
|
app.rndata = get_rntuple_data(arena, app.inspected_file, app.ntpl_name);
|
||||||
|
|
||||||
|
@ -142,7 +143,6 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
make_viewer(app, args.n_cols);
|
make_viewer(app, args.n_cols);
|
||||||
app.viewer.base_display_addr = args.start_addr;
|
|
||||||
|
|
||||||
// Start main loop
|
// Start main loop
|
||||||
run_main_loop(window, arena, app);
|
run_main_loop(window, arena, app);
|
||||||
|
|
Loading…
Reference in a new issue