2#include "message_ids.h"
5#include "sprite/npc/WorldGoombario.h"
6#include "sprite/npc/WorldKooper.h"
7#include "sprite/npc/WorldBombette.h"
8#include "sprite/npc/WorldParakarry.h"
9#include "sprite/npc/WorldBow.h"
10#include "sprite/npc/WorldWatt.h"
11#include "sprite/npc/WorldSushie.h"
12#include "sprite/npc/WorldLakilester.h"
29static s32 gPausePartnersIconIDs[8];
30static s32 gPausePartnersSpriteIDs[8];
31static s32 gPausePartnersPartnerIdx[8];
32static s32 gPausePartnersCurrentPartnerIdx;
33static s32 gPausePartnersSelectedMove;
34static f32 gPausePartnersRotAngle;
35static s32 gPausePartnersLevel;
36static s32 gPausePartnersNumPartners;
43extern u8 D_PAL_80271B38[];
44extern u8 D_PAL_80271B3C[];
45extern u8 D_PAL_80271B40[];
46extern u8 D_PAL_80271B44[];
47extern u8 D_PAL_80271B48[];
48extern u8 D_PAL_80271B4C[];
49extern u8 D_PAL_80271B50[];
75 .vscale = { 640, 480, 511, 0 },
76 .vtrans = { 640, 480, 511, 0 },
82 ANIM_WorldGoombario_Still,
83 ANIM_WorldGoombario_Walk,
84 ANIM_WorldGoombario_Talk,
88 ANIM_WorldKooper_Still,
89 ANIM_WorldKooper_Walk,
90 ANIM_WorldKooper_Talk,
94 ANIM_WorldBombette_Still,
95 ANIM_WorldBombette_Walk,
96 ANIM_WorldBombette_Talk,
100 ANIM_WorldParakarry_Still,
101 ANIM_WorldParakarry_Walk,
102 ANIM_WorldParakarry_Talk,
112 ANIM_WorldWatt_Still,
118 ANIM_WorldSushie_Still,
119 ANIM_WorldSushie_Walk,
120 ANIM_WorldSushie_Talk,
124 ANIM_WorldLakilester_Still,
125 ANIM_WorldLakilester_Walk,
126 ANIM_WorldLakilester_Talk,
143 MSG_PartnerDesc_Goombario_Pause,
144 MSG_PartnerDesc_Kooper_Pause,
145 MSG_PartnerDesc_Bombette_Pause,
146 MSG_PartnerDesc_Parakarry_Pause,
147 MSG_PartnerDesc_Bow_Pause,
148 MSG_PartnerDesc_Watt_Pause,
149 MSG_PartnerDesc_Sushie_Pause,
150 MSG_PartnerDesc_Lakilester_Pause
186 gsSPTexture(-1, -1, 0, G_TX_RENDERTILE, G_ON),
187 gsDPSetCycleType(G_CYC_1CYCLE),
188 gsDPSetTexturePersp(G_TP_NONE),
189 gsDPSetTextureDetail(G_TD_CLAMP),
190 gsDPSetTextureLOD(G_TL_TILE),
191 gsDPSetTextureLUT(G_TT_RGBA16),
192 gsDPSetTextureFilter(G_TF_POINT),
193 gsDPSetTextureConvert(G_TC_FILT),
194 gsDPSetRenderMode(G_RM_OPA_SURF, G_RM_OPA_SURF2),
196 gsSPClearGeometryMode(G_LIGHTING),
197 gsSPSetGeometryMode(G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH),
206 .pos = { .x = 3, .y = 16 },
219 .pos = { .x = 8, .y = 103 },
232 .pos = { .x = 133, .y = 36 },
245 .pos = { .x = 12, .y = -6 },
258 .pos = { .x = 102, .y = -12 },
270u8
gPausePartnersPortraitScrollInterpTable[] = {0, 1, 2, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8 };
317 f32 currentPos, angle, scale;
318 f32 offsetX, offsetY, offsetZ;
321 s32 portraitScrollPos;
322 s32 portraitScrollIndex;
328 guOrthoF(matrix, 0.0f, 320.0f, 240.0f, 0.0f, -100.0f, 100.0f, 1.0f);
335 for (i = 0; i < gPausePartnersNumPartners; i++) {
336 currentPos =
cos_deg(i * 360 / gPausePartnersNumPartners - gPausePartnersRotAngle) * 20.0f + 0.0f;
338 for (j = 0; j < i; j++) {
339 if (currentPos < partnerPositions[j].
pos) {
344 for (k = gPausePartnersNumPartners - 1; k > j; k--) {
345 partnerPositions[k] = partnerPositions[k-1];
348 partnerPositions[j].
index = i;
349 partnerPositions[j].
pos = currentPos;
352 for (j = 0; j < gPausePartnersNumPartners; j++) {
353 portraitIndex = gPausePartnersNumPartners;
354 index = partnerPositions[j].
index;
355 angle = index * 360 / gPausePartnersNumPartners - gPausePartnersRotAngle;
356 offsetX = gPausePartnersNumPartners * 3 + 17;
359 offsetZ = 30.0f -
cos_deg(angle) * 30.0f;
360 offsetY =
cos_deg(angle) * 20.0f + 0.0f;
361 scale = 30.0 / (offsetZ + 60.0f) + 0.5;
363 guTranslateF(matrix, baseX + 22 + offsetX, baseY + 81 + offsetY, -offsetZ);
364 guRotateF(matrix2, 180.0f, 0.0f, 0.0f, 1.0f);
366 guScaleF(matrix2, scale, scale, 1.0f);
369 if (offsetZ > 8.0f) {
372 color = 255.0f - offsetZ * 95.0f * 0.125f;
375 spr_draw_npc_sprite(gPausePartnersSpriteIDs[gPausePartnersPartnerIdx[index]], 0, 0, NULL, matrix);
381 if (currentTab == 4) {
382 if (gPausePartnersLevel == 0) {
414 portraitScrollPos = (gPausePartnersRotAngle + 360.0f) * 15000.0f * gPausePartnersNumPartners / 360.0f;
415 portraitScrollIndex = portraitScrollPos / 15000;
416 gDPSetScissor(
gMainGfxPos++, G_SC_NON_INTERLACE, x1, y1, x2, y2);
417 portraitOffsetX = (portraitScrollIndex * 15000 - portraitScrollPos);
418 portraitOffsetX *= 0.01;
419 portraitIndex = portraitScrollIndex;
425 for (index = 0; index < 20; index++) {
426 if (12 * index + 12 <= 105) {
429 tileHeight = 106 - 12 * index;
433 0, 12 * index, 149, 12 * index + tileHeight - 1, 0,
434 G_TX_CLAMP, G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
435 pause_draw_rect((baseX + 130 + portraitOffsetX) * 4, (baseY + 24 + 12 * index) * 4, (baseX + 280 + portraitOffsetX) * 4, (baseY + 24 + 12 * index + tileHeight) * 4, 0, 0,
436 12 * index * 32, 0x400, 0x400);
438 if (12 * index + 12 >= 105) {
468 gDPSetScissor(
gMainGfxPos++, G_SC_NON_INTERLACE, x1, y1, x2, y2);
470 draw_box(0, &
gPauseWS_21, baseX + 122, baseY + 16, 0, 166, 121, opacity, darkening, 1.0f, 1.0f, 0, 0, 0, 0, 0, 0, width, height, 0);
496 }
else if (level == 2) {
520 for (i = 0; i < 4; i++) {
522 msgY = baseY + 22 + i * 13;
593 gPausePartnersNumPartners = 0;
596 gPausePartnersPartnerIdx[gPausePartnersNumPartners] = i;
597 gPausePartnersNumPartners++;
601 if (gPausePartnersNumPartners == 0) {
629 gPausePartnersCurrentPartnerIdx = 0;
630 for (i = 0; i < gPausePartnersNumPartners; i++) {
632 gPausePartnersCurrentPartnerIdx = i;
637 gPausePartnersSelectedMove = 0;
638 gPausePartnersLevel = 0;
639 gPausePartnersRotAngle = gPausePartnersCurrentPartnerIdx * 360 / gPausePartnersNumPartners;
671 gPausePartnersCurrentPartnerIdx += delta;
673 if (gPausePartnersCurrentPartnerIdx < 0) {
674 gPausePartnersCurrentPartnerIdx = gPausePartnersNumPartners - 1;
675 if (gPausePartnersRotAngle < 360.0f) {
676 gPausePartnersRotAngle += 360.0f;
678 }
else if (gPausePartnersCurrentPartnerIdx >= gPausePartnersNumPartners) {
679 gPausePartnersCurrentPartnerIdx = 0;
680 if (gPausePartnersRotAngle > 0.0f) {
681 gPausePartnersRotAngle -= 360.0f;
685 gPausePartnersSelectedMove = 0;
700 if (gPausePartnersLevel == 1) {
701 oldPos = gPausePartnersSelectedMove;
706 }
else if (level2 == 1) {
708 }
else if (level2 == 0) {
713 gPausePartnersSelectedMove--;
716 gPausePartnersSelectedMove++;
719 if (gPausePartnersSelectedMove < 0) {
720 gPausePartnersSelectedMove = level2 - 1;
721 }
else if (gPausePartnersSelectedMove >= level2) {
722 gPausePartnersSelectedMove = 0;
725 if (gPausePartnersSelectedMove != oldPos) {
731 gPausePartnersLevel = 1;
738 if (gPausePartnersLevel == 0) {
743 gPausePartnersLevel = 0;
752 if (gPausePartnersLevel == 0) {
754 }
else if (gPausePartnersSelectedMove == 0) {
768 deltaBefore = gPausePartnersCurrentPartnerIdx * 360 / gPausePartnersNumPartners - gPausePartnersRotAngle;
769 absValue = abs(deltaBefore);
770 sgn =
sign(deltaBefore);
772 if (absValue >= 16) {
773 delta = deltaBefore * 0.3;
776 gPausePartnersRotAngle = (int)gPausePartnersRotAngle;
778 gPausePartnersRotAngle += delta;
780 for (i = 0; i < gPausePartnersNumPartners; i++) {
781 if (i == gPausePartnersCurrentPartnerIdx) {
792 for (i = 0; i <
ARRAY_COUNT(gPausePartnersIconIDs); i++) {
796 for (i = 0; i <
ARRAY_COUNT(gPausePartnersSpriteIDs); i++) {
PartnerPopupProperties gPartnerPopupProperties[]
@ DRAW_NUMBER_STYLE_ALIGN_RIGHT
drawn to the left of posX
@ DRAW_NUMBER_STYLE_MONOSPACE
@ DRAW_NUMBER_CHARSET_THIN
@ SOUND_MENU_CHANGE_SELECTION
@ WIN_PAUSE_PARTNERS_TITLE
@ WIN_PAUSE_PARTNERS_MOVELIST_TITLE
@ WIN_PAUSE_PARTNERS_MOVELIST_FLOWER
@ WIN_PAUSE_PARTNERS_MOVELIST
void set_window_update(s32 panelID, s32)
void * load_asset_by_name(const char *assetName, u32 *decompressedSize)
void setup_pause_menu_tab(MenuWindowBP *bpArray, s32 arraySize)
s32 general_heap_free(void *data)
void decode_yay0(void *src, void *dst)
void draw_number(s32 value, s32 x, s32 y, s32 variableWidthChars, s32 palette, s32 opacity, u16 style)
void hud_element_set_scale(s32 index, f32 scale)
void hud_element_draw_without_clipping(s32 id)
void hud_element_set_render_pos(s32 id, s32 x, s32 y)
s32 hud_element_create(HudScript *anim)
Creates a new HUD element and returns its ID.
void hud_element_set_flags(s32 id, s32 flags)
Turns on the given flags.
void hud_element_free(s32 id)
HudScript * gPauseCurrentDescIconScript
WindowStyleCustom gPauseWS_21
WindowStyleCustom gPauseWS_20
WindowStyleCustom gPauseWS_22
s32 pause_get_menu_msg(s32 index)
@ PAUSE_MSG_PARTNER_ABILITIES
void pause_draw_menu_label(s32 index, s32 x, s32 y)
void pause_set_cursor_pos(s32 windowID, s32 posX, s32 posY)
void pause_draw_rect(s32 ulx, s32 uly, s32 lrx, s32 lry, s32 tileIdx, s32 uls, s32 ult, s32 dsdx, s32 dtdy)
s32 gPausePartnersNextPortraitIndex
void pause_partners_init(MenuPanel *panel)
s32 gPausePartnersCurrentPortraitIndex
Vp gPausePartnersViewport
void pause_partners_cleanup(MenuPanel *panel)
void pause_partners_draw_title(MenuPanel *menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening)
MenuWindowBP gPausePartnersWindowBPs[]
void pause_partners_load_portrait(s32 index)
void pause_partners_draw_movelist_title(MenuPanel *menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening)
s32 gPausePartnersPartnerIDs[]
s32 gPausePartnersSpriteAnims[][4]
s8 * gPausePartnersImageBuffers[]
HudScript * gPausePartnersIconScripts[][8]
void pause_partners_draw_movelist(MenuPanel *menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening)
s8 gPausePartnersGridData[]
void pause_partners_handle_input(MenuPanel *panel)
char * gPausePartnersAssetNames[]
s32 gPausePartnersMoveBase[]
void pause_partners_draw_contents(MenuPanel *menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening)
s8 gPauseBufferImg2[15752]
void pause_partners_update(MenuPanel *panel)
MenuPanel gPausePanelPartners
u8 gPausePartnersPortraitScrollInterpTable[]
s8 * gPausePartnersPaletteBuffers[]
s8 gPauseBufferImg1[15752]
void pause_partners_draw_movelist_flower(MenuPanel *menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening)
s32 gPausePartnersMessages[]
void sfx_play_sound(s32 soundID)
s32 spr_draw_npc_sprite(s32 spriteInstanceID, s32 yaw, s32 arg2, PAL_PTR *paletteList, Matrix4f mtx)
s32 spr_update_sprite(s32 spriteInstanceID, s32 animID, f32 timeScale)
s32 spr_free_sprite(s32 spriteInstanceID)
void set_npc_imgfx_all(s32 spriteIdx, ImgFXType imgfxType, s32 imgfxArg1, s32 imgfxArg2, s32 imgfxArg3, s32 imgfxArg4, s32 imgfxArg5)
s32 spr_load_npc_sprite(s32 animID, u32 *extraAnimList)
#define ANIM_LIST_END
Terminates an extraAnimationList.
DisplayContext * gDisplayContext