Compare commits
10 commits
a0aa6a8d36
...
fe924743ef
Author | SHA1 | Date | |
---|---|---|---|
|
fe924743ef | ||
|
d3786e4c6d | ||
|
523099206b | ||
|
a57f48d5ff | ||
|
57bf7675f8 | ||
|
6468ad1dd7 | ||
|
331eec77e6 | ||
|
a876064718 | ||
|
cdcf1db83a | ||
|
c83d457738 |
9 changed files with 662 additions and 427 deletions
BIN
lmext1.root
BIN
lmext1.root
Binary file not shown.
BIN
lmext1_uncomp.root
Normal file
BIN
lmext1_uncomp.root
Normal file
Binary file not shown.
894
src/hover.cpp
894
src/hover.cpp
File diff suppressed because it is too large
Load diff
|
@ -213,7 +213,7 @@ void viewer_jump_to_cluster(App_State &app, u64 cluster_idx)
|
|||
}
|
||||
|
||||
internal
|
||||
void imgui_render_string_tree(Arena *arena, String8_Node *root, u16 indent = 0)
|
||||
void imgui_render_string_tree(Arena *arena, String8_Node *root, String8_Node *highlighted, u16 indent = 0)
|
||||
{
|
||||
String8 indent_str;
|
||||
if (indent) {
|
||||
|
@ -225,10 +225,13 @@ void imgui_render_string_tree(Arena *arena, String8_Node *root, u16 indent = 0)
|
|||
}
|
||||
|
||||
for (String8_Node *node = root; node; node = node->next) {
|
||||
if (node == highlighted)
|
||||
ImGui::TextColored(ImColor(1.0f, 1.0f, 0.0f), "%s%s", indent_str.c(), node->str.c());
|
||||
else
|
||||
ImGui::Text("%s%s", indent_str.c(), node->str.c());
|
||||
|
||||
if (node->first_child)
|
||||
imgui_render_string_tree(arena, node->first_child, indent + 2);
|
||||
imgui_render_string_tree(arena, node->first_child, highlighted, indent + 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -397,7 +400,7 @@ void update_and_render(Arena *arena, App_State &app, f32 delta_time_ms)
|
|||
ImGui::TextColored(ImColor(0.5f, 0.5f, 0.5f), "(Hint: press Alt for single-field hover information)");
|
||||
if (hovered_section.id == Sec_Page)
|
||||
ImGui::TextColored(ImColor(0.5f, 0.5f, 0.5f), "(Hint: Shift-Click to jump to the start of this page)");
|
||||
imgui_render_string_tree(scratch.arena, hover_info.desc->head);
|
||||
imgui_render_string_tree(scratch.arena, hover_info.desc->head, hover_info.highlighted_desc);
|
||||
app.viewer.hovered_range = hover_info.rng;
|
||||
|
||||
// Shift-clicking on a page section will update the current page in the legend
|
||||
|
|
|
@ -140,7 +140,7 @@ internal const String8 section_names[Sec_COUNT] = {
|
|||
str8("None"),
|
||||
str8("TFile Header"),
|
||||
str8("TFile Object"),
|
||||
str8("TFile Info"),
|
||||
str8("TFile Streamer Info"),
|
||||
str8("TFile FreeList"),
|
||||
str8("TKey List"),
|
||||
str8("RNTuple Anchor"),
|
||||
|
|
|
@ -26,8 +26,9 @@
|
|||
#include <cmath>
|
||||
#include <cstring>
|
||||
#include <cassert>
|
||||
#include <inttypes.h> // PRIu64
|
||||
#include <inttypes.h> // PRIu64, ...
|
||||
|
||||
#include <type_traits> // For std::decay_t and std::is_same_v
|
||||
#include <chrono>
|
||||
|
||||
#ifdef DEBUG
|
||||
|
@ -45,7 +46,7 @@
|
|||
#endif // RNT_NO_GFX
|
||||
|
||||
#define V_MAJOR "0"
|
||||
#define V_MINOR "5"
|
||||
#define V_MINOR "6"
|
||||
|
||||
#include "root/root_inc.h"
|
||||
#include "root/RMicroFileReader.hxx"
|
||||
|
|
|
@ -1223,11 +1223,8 @@ RMicroFileReader::GetNTupleProper(const char *ntupleName)
|
|||
// @Incomplete: each section has a differently-sized RBlob, we need to account for that!
|
||||
RTFString blobName { kBlobClassName };
|
||||
RTFKey dummy;
|
||||
// FIXME: it seems that sometimes even if IsBigFile() == false we get a big header size!
|
||||
if (fileHeader.IsBigFile())
|
||||
dummy.MakeBigKey();
|
||||
fileInfo.rblob_key_header_nbytes = dummy.GetHeaderSize() + blobName.GetSize() + 2 * RTFString{}.GetSize();
|
||||
printf("nbytes: %lu\n", fileInfo.rblob_key_header_nbytes);
|
||||
fileInfo.rblob_key_header_nbytes = dummy.fKeyHeaderSize + blobName.GetSize() + 2 * RTFString{}.GetSize();
|
||||
}
|
||||
// @----
|
||||
ReadBuffer(ntuple, objNbytes, offset);
|
||||
|
|
49
src/str.cpp
49
src/str.cpp
|
@ -39,37 +39,52 @@ String8 to_pretty_size(Arena *arena, u64 bytes)
|
|||
}
|
||||
|
||||
internal
|
||||
String8_Node *push_str8_node(Arena *arena, String8_Node *prev, const char *fmt, ...)
|
||||
String8_Node *push_str8_node_v(Arena *arena, String8_Node *prev, const char *fmt, va_list args)
|
||||
{
|
||||
va_list args2;
|
||||
va_copy(args2, args);
|
||||
|
||||
String8_Node *snode = arena_push<String8_Node>(arena);
|
||||
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
snode->str = push_str8fv(arena, fmt, args);
|
||||
va_end(args);
|
||||
snode->str = push_str8fv(arena, fmt, args2);
|
||||
|
||||
if (prev) {
|
||||
prev->next = snode;
|
||||
snode->head = prev->head;
|
||||
snode->parent = prev->parent;
|
||||
} else {
|
||||
snode->head = snode;
|
||||
}
|
||||
snode->prev = prev;
|
||||
|
||||
va_end(args2);
|
||||
return snode;
|
||||
}
|
||||
|
||||
internal
|
||||
String8_Node *push_str8_node_child(Arena *arena, String8_Node *parent, const char *fmt, ...)
|
||||
String8_Node *push_str8_node(Arena *arena, String8_Node *prev, const char *fmt, ...)
|
||||
{
|
||||
assert(parent);
|
||||
|
||||
String8_Node *snode = arena_push<String8_Node>(arena);
|
||||
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
snode->str = push_str8fv(arena, fmt, args);
|
||||
String8_Node *snode = push_str8_node_v(arena, prev, fmt, args);
|
||||
va_end(args);
|
||||
return snode;
|
||||
}
|
||||
|
||||
internal
|
||||
String8_Node *push_str8_node_child_v(Arena *arena, String8_Node *parent, const char *fmt, va_list args)
|
||||
{
|
||||
va_list args2;
|
||||
va_copy(args2, args);
|
||||
if (!parent) {
|
||||
// If there is no parent, just behave the same as push_str8_node.
|
||||
String8_Node *snode = push_str8_node_v(arena, nullptr, fmt, args2);
|
||||
va_end(args2);
|
||||
return snode;
|
||||
}
|
||||
|
||||
String8_Node *snode = arena_push<String8_Node>(arena);
|
||||
snode->str = push_str8fv(arena, fmt, args2);
|
||||
|
||||
snode->prev = parent->last_child;
|
||||
if (parent->first_child) {
|
||||
|
@ -79,7 +94,19 @@ String8_Node *push_str8_node_child(Arena *arena, String8_Node *parent, const cha
|
|||
parent->last_child = parent->first_child = snode;
|
||||
}
|
||||
snode->head = parent->head;
|
||||
snode->parent = parent;
|
||||
|
||||
va_end(args2);
|
||||
return snode;
|
||||
}
|
||||
|
||||
internal
|
||||
String8_Node *push_str8_node_child(Arena *arena, String8_Node *parent, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
String8_Node *snode = push_str8_node_child_v(arena, parent, fmt, args);
|
||||
va_end(args);
|
||||
return snode;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,5 +14,6 @@ struct String8 {
|
|||
struct String8_Node {
|
||||
String8_Node *next, *prev, *head;
|
||||
String8_Node *first_child, *last_child;
|
||||
String8_Node *parent;
|
||||
String8 str;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue