- Migrate from set_global/get_global to ctx_set/ctx_get - Replace if-else chains with match() expressions - Update inline pointer handling patterns - Improve GfxWorld and asset parsing structures - Clean up redundant code across 60+ definition files Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
25 lines
512 B
Plaintext
25 lines
512 B
Plaintext
type rawfile [display="Raw File"]
|
|
{
|
|
const PTR_INLINE = -1;
|
|
|
|
i32 name_ptr;
|
|
i32 len;
|
|
i32 buffer_ptr;
|
|
|
|
ui("name_ptr", "Name Ptr");
|
|
ui("len", "Length");
|
|
ui("buffer_ptr", "Buffer Ptr");
|
|
|
|
// Inline data
|
|
inline cstring name when name_ptr [ui="Name", set_name];
|
|
|
|
// Data buffer (if inline) - read len + 1 bytes for null terminator
|
|
if (buffer_ptr == PTR_INLINE && len > 0) {
|
|
raw_data = read(len + 1);
|
|
ui("raw_data", "Raw Data");
|
|
|
|
set_viewer("text");
|
|
set_text(ascii(raw_data));
|
|
}
|
|
}
|