Compare commits
No commits in common. "fe924743eff51c8f5861aa641d61aee7d6fe50db" and "a0aa6a8d36352e4fa1b6cc16603beb3d6e91d3ce" have entirely different histories.
fe924743ef
...
a0aa6a8d36
9 changed files with 424 additions and 659 deletions
BIN
lmext1.root
BIN
lmext1.root
Binary file not shown.
Binary file not shown.
1008
src/hover.cpp
1008
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, String8_Node *highlighted, u16 indent = 0)
|
||||
void imgui_render_string_tree(Arena *arena, String8_Node *root, u16 indent = 0)
|
||||
{
|
||||
String8 indent_str;
|
||||
if (indent) {
|
||||
|
@ -225,13 +225,10 @@ void imgui_render_string_tree(Arena *arena, String8_Node *root, String8_Node *hi
|
|||
}
|
||||
|
||||
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());
|
||||
ImGui::Text("%s%s", indent_str.c(), node->str.c());
|
||||
|
||||
if (node->first_child)
|
||||
imgui_render_string_tree(arena, node->first_child, highlighted, indent + 2);
|
||||
imgui_render_string_tree(arena, node->first_child, indent + 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -400,7 +397,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, hover_info.highlighted_desc);
|
||||
imgui_render_string_tree(scratch.arena, hover_info.desc->head);
|
||||
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 Streamer Info"),
|
||||
str8("TFile Info"),
|
||||
str8("TFile FreeList"),
|
||||
str8("TKey List"),
|
||||
str8("RNTuple Anchor"),
|
||||
|
|
|
@ -26,9 +26,8 @@
|
|||
#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
|
||||
|
@ -46,7 +45,7 @@
|
|||
#endif // RNT_NO_GFX
|
||||
|
||||
#define V_MAJOR "0"
|
||||
#define V_MINOR "6"
|
||||
#define V_MINOR "5"
|
||||
|
||||
#include "root/root_inc.h"
|
||||
#include "root/RMicroFileReader.hxx"
|
||||
|
|
|
@ -1223,8 +1223,11 @@ RMicroFileReader::GetNTupleProper(const char *ntupleName)
|
|||
// @Incomplete: each section has a differently-sized RBlob, we need to account for that!
|
||||
RTFString blobName { kBlobClassName };
|
||||
RTFKey dummy;
|
||||
dummy.MakeBigKey();
|
||||
fileInfo.rblob_key_header_nbytes = dummy.fKeyHeaderSize + blobName.GetSize() + 2 * RTFString{}.GetSize();
|
||||
// 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);
|
||||
}
|
||||
// @----
|
||||
ReadBuffer(ntuple, objNbytes, offset);
|
||||
|
|
49
src/str.cpp
49
src/str.cpp
|
@ -39,52 +39,37 @@ String8 to_pretty_size(Arena *arena, u64 bytes)
|
|||
}
|
||||
|
||||
internal
|
||||
String8_Node *push_str8_node_v(Arena *arena, String8_Node *prev, const char *fmt, va_list args)
|
||||
String8_Node *push_str8_node(Arena *arena, String8_Node *prev, const char *fmt, ...)
|
||||
{
|
||||
va_list args2;
|
||||
va_copy(args2, args);
|
||||
|
||||
String8_Node *snode = arena_push<String8_Node>(arena);
|
||||
|
||||
snode->str = push_str8fv(arena, fmt, args2);
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
snode->str = push_str8fv(arena, fmt, args);
|
||||
va_end(args);
|
||||
|
||||
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(Arena *arena, String8_Node *prev, const char *fmt, ...)
|
||||
String8_Node *push_str8_node_child(Arena *arena, String8_Node *parent, const char *fmt, ...)
|
||||
{
|
||||
assert(parent);
|
||||
|
||||
String8_Node *snode = arena_push<String8_Node>(arena);
|
||||
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
String8_Node *snode = push_str8_node_v(arena, prev, fmt, args);
|
||||
snode->str = push_str8fv(arena, 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) {
|
||||
|
@ -94,19 +79,7 @@ String8_Node *push_str8_node_child_v(Arena *arena, String8_Node *parent, const c
|
|||
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,6 +14,5 @@ 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