mirror of
https://github.com/zeldaret/mm.git
synced 2026-06-18 07:05:21 -04:00
Macros: PLAYER -> GET_PLAYER(globalCtx) and ACTIVE_CAM -> GET_ACTIVE_CAM(globalCtx) (#283)
* PLAYER -> GET_PLAYER(globalCtx), ACTIVE_CAM -> GET_ACTIVE_CAM(globalCtx) * formatter * PR Suggestions * `FIRST_ENEMY` -> `GET_FIRST_ENEMY(globalCtx)` * Fix merge conflicts
This commit is contained in:
+3
-4
@@ -17,8 +17,7 @@
|
||||
#define VIRTUAL_TO_PHYSICAL(addr) (uintptr_t)((u8*)(addr)-0x80000000)
|
||||
#define SEGMENTED_TO_VIRTUAL(addr) (void*)(PHYSICAL_TO_VIRTUAL(gSegments[SEGMENT_NUMBER(addr)]) + SEGMENT_OFFSET(addr))
|
||||
|
||||
// Currently most often called ctxt in MM, TODO: Refactor names when its used
|
||||
#define ACTIVE_CAM globalCtx->cameraPtrs[globalCtx->activeCamera]
|
||||
#define GET_ACTIVE_CAM(globalCtx) ((globalCtx)->cameraPtrs[(globalCtx)->activeCamera])
|
||||
#define MAIN_CAM 0
|
||||
#define SUBCAM_FREE 0
|
||||
|
||||
@@ -37,9 +36,9 @@
|
||||
} \
|
||||
(void)0
|
||||
|
||||
#define PLAYER ((Player*)globalCtx->actorCtx.actorList[ACTORCAT_PLAYER].first)
|
||||
#define GET_PLAYER(globalCtx) ((Player*)(globalCtx)->actorCtx.actorList[ACTORCAT_PLAYER].first)
|
||||
|
||||
#define FIRST_ENEMY ((Actor*)globalCtx->actorCtx.actorList[ACTORCAT_ENEMY].first)
|
||||
#define GET_FIRST_ENEMY(globalCtx) ((Actor*)(globalCtx)->actorCtx.actorList[ACTORCAT_ENEMY].first)
|
||||
|
||||
// linkAge still exists in MM, but is always set to 0 (always adult)
|
||||
// There are remnants of these macros from OOT, but they are essentially useless
|
||||
|
||||
Reference in New Issue
Block a user