Cleanup: object.c - #218
Conversation
|
Completely converting the models at load time turned out to be easier than rolling up the primitive structs. We now have three primitive types used by the whole game: triangle, quadrilateral, billboard. Aurora borealis was simplest to rewrite from scratch. The memory penalty last I checked was 2% (I commented out the spline struct since we don't yet have an implementation for it.) This will also conflict with #215. |
|
The enum and flags for PSX primitives are now in Backface culling is now accurate to PSX using |
Instead of tagged-type-puns, primitives are now tagged unions. This means all primitives are the same size, which in turn means we can keep them in simple arrays. That allows
mem_bump_unalignedto be retired, and means primitives can be indexed the normal way, rather than using an increment for each type.Using fixed-width primitives comes with a memory penalty, but it is not very much in practice (on Altima VII, 19% more total memory spent on objects.) This is partially because I have thrown out both light-sourced polygons and light source primitives. wipeout-rewrite does not support them, but still had loading code for them. wipEout, Wipeout 2097, and Wipeout 64 never use them. I have also removed padding and the mysterious, unused
cba/tsbfields.I've checked that all the dynamic effects from #217 still work.
Rolling up the individual structs (
u0 v0 u1 v1 u2 v2 u3 v3is not ideal) could be a good idea, but it looks like a project in and of itself.This will conflict with #216.