mirror of
https://github.com/zeldaret/af.git
synced 2026-09-28 06:49:04 -04:00
09ac5c453d
* C file * mSM_submenu_ct, mSM_submenu_dt, mSM_submenu_move * SubmenuArea_DoLink, SubmenuArea_DoUnlink, load_player * mSM_submenu_ovlptr_cleanup * mSM_move_Wait, mSM_move_PREWait, mSM_move_Play * func_800C497C_jp * mSM_submenu_ctrl * mSM_ovlptr_dllcnv_sub, mSM_ovlptr_dllcnv, mSM_open_submenu, mSM_open_submenu_new, mSM_open_submenu_new2, mSM_Reset_player_btn_type1, mSM_Reset_player_btn_type2, mSM_submenu_draw * fix warnings * name functions referenced by check_process * migrate data * func_800C47B4_jp NON_MATCHING * mSM_check_item_for_furniture, mSM_check_item_for_sell, mSM_check_item_for_give, mSM_check_item_for_take, mSM_check_item_for_minidisk, mSM_check_item_for_shrine, mSM_check_item_for_entrust, mSM_check_item_for_exchange * rename remaining functions * match mSM_submenu_ovlptr_init * cleanup mSM_submenu_ovlptr_init * match mSM_move_LINKWait? * Rename mSM struct and other cleanups * enums * cleanup * format * move unknown struct to header * typo
26 lines
743 B
C
26 lines
743 B
C
#ifndef MACROS_H
|
|
#define MACROS_H
|
|
|
|
#if defined(__GNUC__) || defined(__clang__)
|
|
#define UNREACHABLE __builtin_unreachable()
|
|
#else
|
|
#define UNREACHABLE
|
|
#endif
|
|
|
|
#define SCREEN_WIDTH 320
|
|
#define SCREEN_HEIGHT 240
|
|
|
|
#define PROJECTED_TO_SCREEN_X(projectedPos, invW) ((projectedPos).x * (invW) * (SCREEN_WIDTH / 2) + (SCREEN_WIDTH / 2))
|
|
#define PROJECTED_TO_SCREEN_Y(projectedPos, invW) ((projectedPos).y * (invW) * (-SCREEN_HEIGHT / 2) + (SCREEN_HEIGHT / 2))
|
|
|
|
#define ARRAY_COUNT(arr) (s32)(sizeof(arr) / sizeof(arr[0]))
|
|
#define ARRAY_COUNTU(arr) (u32)(sizeof(arr) / sizeof(arr[0]))
|
|
|
|
#define ABS(x) (((x) >= 0) ? (x): -(x))
|
|
|
|
#define CLAMP(x, min, max) ((x) < (min) ? (min) : (x) > (max) ? (max) : (x))
|
|
|
|
#define DECR(x) ((x) == 0 ? 0 : --(x))
|
|
|
|
#endif
|