mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-03 06:24:30 +00:00
Clean up custom LoadTextureBlock in z_map_mark.c and z_lmap_mark.c (#1896)
* experimental inc.c * make it look proper * make table types u32 * ZCONST -> COND_CONST * Tharo suggestion and comment * implement MM Decomp suggestions * fix minor nits * Update header guard
This commit is contained in:
parent
bf3339a16d
commit
7eee97429f
3 changed files with 82 additions and 34 deletions
|
@ -13,25 +13,14 @@ typedef struct {
|
|||
/* 0x20 */ u32 dtdy;
|
||||
} PauseMapMarkInfo; // size = 0x24
|
||||
|
||||
#define GDP_LOADTEXTUREBLOCK_RUNTIME_QUALIFIERS const
|
||||
#include "src/code/gDPLoadTextureBlock_Runtime.inc.c"
|
||||
|
||||
static PauseMapMarkInfo sMapMarkInfoTable[] = {
|
||||
{ gMapChestIconTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 8, 32, 32, 1 << 10, 1 << 10 },
|
||||
{ gMapBossIconTex, G_IM_FMT_IA, G_IM_SIZ_8b, 8, 8, 32, 32, 1 << 10, 1 << 10 },
|
||||
};
|
||||
|
||||
static const u32 sBaseImageSizes[] = { 0, 1, 2, 3 };
|
||||
static const u32 sLoadBlockImageSizes[] = { 2, 2, 2, 3 };
|
||||
static const u32 sIncrImageSizes[] = { 3, 1, 0, 0 };
|
||||
static const u32 sShiftImageSizes[] = { 2, 1, 0, 0 };
|
||||
static const u32 sBytesImageSizes[] = { 0, 1, 2, 4 };
|
||||
static const u32 sLineBytesImageSizes[] = { 0, 1, 2, 2 };
|
||||
|
||||
#define G_IM_SIZ_MARK sBaseImageSizes[markInfo->imageSize]
|
||||
#define G_IM_SIZ_MARK_LOAD_BLOCK sLoadBlockImageSizes[markInfo->imageSize]
|
||||
#define G_IM_SIZ_MARK_INCR sIncrImageSizes[markInfo->imageSize]
|
||||
#define G_IM_SIZ_MARK_SHIFT sShiftImageSizes[markInfo->imageSize]
|
||||
#define G_IM_SIZ_MARK_BYTES sBytesImageSizes[markInfo->imageSize]
|
||||
#define G_IM_SIZ_MARK_LINE_BYTES sLineBytesImageSizes[markInfo->imageSize]
|
||||
|
||||
extern PauseMapMarksData gPauseMapMarkDataTable[];
|
||||
|
||||
void PauseMapMark_Init(PlayState* play) {
|
||||
|
@ -122,9 +111,10 @@ void PauseMapMark_DrawForDungeon(PlayState* play) {
|
|||
markInfo = &sMapMarkInfoTable[mapMarkData->markType];
|
||||
|
||||
gDPPipeSync(POLY_OPA_DISP++);
|
||||
gDPLoadTextureBlock(POLY_OPA_DISP++, markInfo->texture, markInfo->imageFormat, G_IM_SIZ_MARK,
|
||||
markInfo->textureWidth, markInfo->textureHeight, 0, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||
gDPLoadTextureBlock_Runtime(POLY_OPA_DISP++, markInfo->texture, markInfo->imageFormat,
|
||||
markInfo->imageSize, markInfo->textureWidth, markInfo->textureHeight, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
|
||||
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||
|
||||
Matrix_Push();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue