Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // =============================================================================
- // =============================================================================
- // IMPORTANT NOTE: The order of elements in this enum is INCREDIBLY important.
- // Because this is three enums in one, they share some pieces of data that must
- // not get overridden.
- // =============================================================================
- // =============================================================================
- enum E_AREA
- {
- //union
- //{
- // struct
- // {
- #if YSIM_HAS_MASTER
- E_AREA_MASTER,
- #endif
- Float:E_AREA_POS[4],
- PlayerArray:E_AREA_PLAYERS<MAX_PLAYERS>,
- // This MUST go between "E_AREA_PLAYERS" and "E_AREA_FLAGS" to
- // remain constant in subsequent unions.
- #if defined AREA_VERY_FAST
- Float:E_AREA_BOUNDING[4],
- #endif
- // As must this.
- #if AREA_WORLDS > 0
- BitArray:E_AREA_WORLDS<AREA_WORLDS>,
- #endif
- // ALWAYS last (actually used by EVERY type).
- e_AREA_FLAGS:E_AREA_FLAGS,
- // }
- // // Start of poly data.
- // struct
- // {
- // Reset the enum counter to 0 (on the next item).
- _E_AREA_RESET_@1 = -1,
- // Now restart.
- #if YSIM_HAS_MASTER
- // Skip the master flag if it exists.
- _E_AREA_MASTER_@1,
- #endif
- // This is where polys differ from all others.
- Float:E_AREA_POLY_POS[2],
- E_AREA_POLY_COUNT,
- E_AREA_POLY_NEXT,
- // Skip all the array and flag data, they stay the same.
- _E_AREA_ARRAYS_@1[E_AREA_FLAGS - E_AREA_PLAYERS + E_AREA:1],
- // }
- // // Start of poly child data.
- // struct
- // {
- // Reset the enum counter to 0 (on the next item).
- _E_AREA_RESET_@2 = -1,
- // Now restart.
- #if YSIM_HAS_MASTER
- // Skip the master flag if it exists.
- _E_AREA_MASTER_@2,
- #endif
- // Store a link to the parent of this poly child.
- E_AREA_CHILD_PARENT,
- #if _:(E_AREA_FLAGS - E_AREA_CHILD_PARENT) & 1
- // There are an ODD number of available slots. We can store an
- // extra pair iff we don't need to use "NEXT".
- //_E_AREA_SKIP_@2,
- E_AREA_CHILD_OPT_X,
- #endif
- // And the next one in VERY rare cases (I hope).
- E_AREA_CHILD_NEXT,
- E_AREA_CHILD_OPT_Y = E_AREA_CHILD_NEXT,
- // Just store a vast number of X/Y pairs in this child.
- E_AREA_CHILD_ELEMS[_:E_AREA_FLAGS - _:E_AREA_CHILD_NEXT - 1],
- // Skip the flags.
- _E_AREA_FLAGS_@2
- // }
- }
- #define CHILD_AREA_SLOTS ((_:E_AREA_FLAGS - _:E_AREA_CHILD_ELEMS) / 2)
Advertisement
Add Comment
Please, Sign In to add comment