principia
principia copied to clipboard
Level loader isn't portable
It uses bit-shifting. So levels wont load on non little endian hardware or they will load, but they will only load on one arch. Haven't had time to test.
Yup its just an intresting issue, but making the level loader more portable isnt bad practice.
This is not a real issue.
- Bit shifts work the same everywhere.
Endianness is the order of bytes (not bits!) in memory.
Integers (or any other data) have to be loaded into registers (which are neither little nor big-endian, they just store the entire 32/64 value at once) before the cpu can perform any operations on them. - x86/x86_64 are always LE and ARM can do both (LE by default). Even if endianness somehow affected registers, it would still be at the lowest priority since big-endian architectures are extremely rare.
Close it. (Deleted my older comment because it was bad)
Btw even if you remove them the compiler will optimize your basic math operations back down to bitwise ones (if possible), producing exactly the same binaries.
Heavily depends on the compiler in general bit-shifting doesn't mean it wont load it could just mean levels on one cpu arch wont load on another.
Ill see if i can get it to compile properly on ppc big endian then let you know my findings
Heavily depends on the compiler in general bit-shifting doesn't mean it wont load it could just mean levels on one cpu arch wont load on another.
That may be a thing but it's not related to bitshifts