mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-03 06:24:30 +00:00
Introduce OPEN_DISPS/CLOSE_DISPS macros (#360)
This commit is contained in:
parent
1f1b5e39f5
commit
2a2fdf7f3e
134 changed files with 3133 additions and 3775 deletions
|
@ -45,9 +45,7 @@
|
|||
|
||||
#define CHECK_QUEST_ITEM(item) (gBitFlags[item] & gSaveContext.questItems)
|
||||
|
||||
#define SET_NEXT_GAMESTATE(curState, newInit, newStruct) \
|
||||
(curState)->init = newInit; \
|
||||
(curState)->size = sizeof(newStruct);
|
||||
#define CHECK_PAD(state, combo) (~(state.in.button | ~(combo)) == 0)
|
||||
|
||||
#define LOG(exp, value, format, file, line) \
|
||||
do { \
|
||||
|
@ -61,7 +59,37 @@
|
|||
#define LOG_NUM(exp, value, file, line) LOG(exp, value, "%d", file, line)
|
||||
#define LOG_HEX(exp, value, file, line) LOG(exp, value, "%x", file, line)
|
||||
|
||||
/*
|
||||
#define SET_NEXT_GAMESTATE(curState, newInit, newStruct) \
|
||||
(curState)->init = newInit; \
|
||||
(curState)->size = sizeof(newStruct)
|
||||
|
||||
#define SET_FULLSCREEN_VIEWPORT(view) \
|
||||
{ \
|
||||
Viewport viewport; \
|
||||
viewport.bottomY = SCREEN_HEIGHT; \
|
||||
viewport.rightX = SCREEN_WIDTH; \
|
||||
viewport.topY = 0; \
|
||||
viewport.leftX = 0; \
|
||||
View_SetViewport(view, &viewport); \
|
||||
} \
|
||||
(void)0
|
||||
|
||||
#define OPEN_DISPS_INNER(gfxCtx, file, line) \
|
||||
oGfxCtx = gfxCtx; \
|
||||
Graph_OpenDisps(dispRefs, gfxCtx, file, line)
|
||||
|
||||
#define OPEN_DISPS(gfxCtx, file, line) \
|
||||
{ \
|
||||
GraphicsContext* oGfxCtx; \
|
||||
Gfx* dispRefs[4]; \
|
||||
OPEN_DISPS_INNER(gfxCtx, file, line)
|
||||
|
||||
#define CLOSE_DISPS(gfxCtx, file, line) \
|
||||
Graph_CloseDisps(dispRefs, gfxCtx, file, line); \
|
||||
} \
|
||||
(void)0
|
||||
|
||||
/**
|
||||
* `x` vertex x
|
||||
* `y` vertex y
|
||||
* `z` vertex z
|
||||
|
@ -76,16 +104,4 @@
|
|||
|
||||
#define VTX_T(x,y,z,s,t,cr,cg,cb,a) { { x, y, z }, 0, { s, t }, { cr, cg, cb, a } }
|
||||
|
||||
#define SET_FULLSCREEN_VIEWPORT(view) \
|
||||
{ \
|
||||
Viewport viewport; \
|
||||
viewport.bottomY = SCREEN_HEIGHT; \
|
||||
viewport.rightX = SCREEN_WIDTH; \
|
||||
viewport.topY = 0; \
|
||||
viewport.leftX = 0; \
|
||||
View_SetViewport(view, &viewport); \
|
||||
}
|
||||
|
||||
#define CHECK_PAD(state, combo) (~(state.in.button | ~(combo)) == 0)
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue