mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-04 06:54:33 +00:00
"decompile" ovl_map_mark_data, make minor tweaks to z_map_mark.c (#704)
* "decompile" ovl_map_mark_data, make minor tweaks to z_map_mark.c * implement some suggestions * eliminate wrapping braces
This commit is contained in:
parent
f4499a8de2
commit
86f16cf662
9 changed files with 2944 additions and 62 deletions
|
@ -1,5 +1,6 @@
|
|||
#include "global.h"
|
||||
#include "vt.h"
|
||||
#include "textures/parameter_static/parameter_static.h"
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ void* texture;
|
||||
|
@ -37,8 +38,8 @@ static u32 sLineBytesImageSizes[] = { 0, 1, 2, 2 };
|
|||
#define G_IM_SIZ_MARK_LINE_BYTES sLineBytesImageSizes[markInfo->imageSize]
|
||||
|
||||
static MapMarkInfo sMapMarkInfoTable[] = {
|
||||
{ D_02002580, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 8, 32, 32, 1024, 1024 }, // Chest Icon
|
||||
{ D_02002900, G_IM_FMT_IA, G_IM_SIZ_8b, 8, 8, 32, 32, 1024, 1024 }, // Boss Skull Icon
|
||||
{ gHUDTreasureMarkerTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 8, 32, 32, 1024, 1024 }, // Chest Icon
|
||||
{ gHUDBossMarkerTex, G_IM_FMT_IA, G_IM_SIZ_8b, 8, 8, 32, 32, 1024, 1024 }, // Boss Skull Icon
|
||||
};
|
||||
|
||||
static MapMarkDataOverlay sMapMarkDataOvl = {
|
||||
|
@ -50,7 +51,7 @@ static MapMarkDataOverlay sMapMarkDataOvl = {
|
|||
gMapMarkDataTable,
|
||||
};
|
||||
|
||||
static MapMarksData** sLoadedMarkDataTable;
|
||||
static MapMarkData** sLoadedMarkDataTable;
|
||||
|
||||
void MapMark_Init(GlobalContext* globalCtx) {
|
||||
MapMarkDataOverlay* overlay = &sMapMarkDataOvl;
|
||||
|
@ -75,7 +76,7 @@ void MapMark_ClearPointers(GlobalContext* globalCtx) {
|
|||
|
||||
void MapMark_Draw(GlobalContext* globalCtx) {
|
||||
InterfaceContext* interfaceCtx;
|
||||
MapMarkData* mapMarkData;
|
||||
MapMarkIconData* mapMarkIconData;
|
||||
MapMarkPoint* markPoint;
|
||||
MapMarkInfo* markInfo;
|
||||
u16 dungeon = gSaveContext.mapIndex;
|
||||
|
@ -85,19 +86,19 @@ void MapMark_Draw(GlobalContext* globalCtx) {
|
|||
|
||||
interfaceCtx = &globalCtx->interfaceCtx;
|
||||
|
||||
if ((gMapData != NULL) && (globalCtx->interfaceCtx.mapRoomNum >= gMapData->dgnMinimapCount[dungeon])) {
|
||||
if (gMapData != NULL && globalCtx->interfaceCtx.mapRoomNum >= gMapData->dgnMinimapCount[dungeon]) {
|
||||
// Translates to: "ROOM NUMBER EXCEEDED, YIKES %d/%d MapMarkDraw PROCESSING INTERRUPTED"
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "部屋番号がオーバーしてるで,ヤバイで %d/%d \nMapMarkDraw の処理を中断します\n",
|
||||
VT_RST, globalCtx->interfaceCtx.mapRoomNum, gMapData->dgnMinimapCount[dungeon]);
|
||||
return;
|
||||
}
|
||||
|
||||
mapMarkData = &sLoadedMarkDataTable[dungeon][interfaceCtx->mapRoomNum][0];
|
||||
mapMarkIconData = &sLoadedMarkDataTable[dungeon][interfaceCtx->mapRoomNum][0];
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_map_mark.c", 303);
|
||||
|
||||
while (true) {
|
||||
if (mapMarkData->markType == -1) {
|
||||
if (mapMarkIconData->markType == MAP_MARK_ICON_NONE) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -106,10 +107,11 @@ void MapMark_Draw(GlobalContext* globalCtx) {
|
|||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->minimapAlpha);
|
||||
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, interfaceCtx->minimapAlpha);
|
||||
|
||||
markPoint = &mapMarkData->points[0];
|
||||
for (i = 0; i < mapMarkData->count; i++) {
|
||||
if ((mapMarkData->markType != 0) || !Flags_GetTreasure(globalCtx, markPoint->chestFlag)) {
|
||||
markInfo = &sMapMarkInfoTable[mapMarkData->markType];
|
||||
markPoint = mapMarkIconData->points;
|
||||
for (i = 0; i < mapMarkIconData->count; i++) {
|
||||
if (mapMarkIconData->markType != MAP_MARK_ICON_CHEST ||
|
||||
!Flags_GetTreasure(globalCtx, markPoint->chestFlag)) {
|
||||
markInfo = &sMapMarkInfoTable[mapMarkIconData->markType];
|
||||
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
gDPLoadTextureBlock(OVERLAY_DISP++, markInfo->texture, markInfo->imageFormat, G_IM_SIZ_MARK,
|
||||
|
@ -124,7 +126,7 @@ void MapMark_Draw(GlobalContext* globalCtx) {
|
|||
}
|
||||
markPoint++;
|
||||
}
|
||||
mapMarkData++;
|
||||
mapMarkIconData++;
|
||||
}
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_map_mark.c", 339);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue