1
0
Fork 0
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:
Roman971 2020-08-30 01:00:17 +02:00 committed by GitHub
parent 1f1b5e39f5
commit 2a2fdf7f3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
134 changed files with 3133 additions and 3775 deletions

View file

@ -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