LennardF1989 / BG3-ImHex-Patterns

BG3 patterns for ImHex
3 stars 1 forks source link

Selective Component Loading #2

Open zirrboy opened 1 year ago

zirrboy commented 1 year ago

Running the pattern, at least on my own, no longer that high spec, machine, is starting to take a while and I think the benefit of colored sections greatly diminishes once almost everything is highlighted.

At least in my own workflow, exploring a component means frequent recompiles, where most of the others aren't required, and make it harder to see what sections that particular component references.

So I'd suggest that only deliberately selected components get parsed, reducing compile latency and visual clutter in the editor.

Some sort of loadAll obviously has its own use, but having that as a separate functionality would also allow running advanced loading, such as owner mapping.

My best idea for now would be to pack the switch case into a separate struct with a name parameter, but more handy solutions probably exist.

Something like this:

[...]
LSMF lsmf @ 0x0;

struct Component<auto name, EntryType> {...};

Component<"game.v0.EntityID", GUID> entityIDs @ 0x0;
LennardF1989 commented 1 year ago

Not sure I understand the proposed idea, but we can probably make the highlights togglable using a define (like the BASE_OFFSET) before including the .pat file. You want to make it so, one could say "only load up component x and y and leave the rest"?

I use the colors to make sure I've at least read all the bytes of the file at some point. A lot of data is outside of the components themselves (eg. the references to translated strings).

zirrboy commented 1 year ago

Yeah, rereading my post it's anything but coherent.