Quote:Original post by asp_
If I would venture a guess I doubt your bottleneck would ever be that code, no matter if you split it to one call per field. I doubt there's any sane reason to do it except for lazyness.
It's also not just platform specific but compiler specific and affected by a lot of factors such as build settings and so on.
I'd say this is as close to a never as you'll get.
Your ventured guess is wrong. Most console games (at least the ones that have decent load times) do something exactly like this. Data structures are read straight off disk into memory, pointers are fixed up and off you go, loading is nothing more than a sequential read into memory and a pointer fix up pass. Hell, some games even skip the pointer fix-up and read the pointers in unchanged, but that really is playing with fire.
It is platform specific but that's what you have asset pipelines for - to convert your non-platform-specific source assets into very-platform-specific runtime assets that load quickly and are formatted optimally for the target platform.
It may not be 'clean' or very cross-platform but sometimes this kind of thing is necessary for performance, particularly on consoles. If more PC games did things this way maybe we wouldn't see PC games that take way longer to load from hard disk than console games load from optical disks.