6#define MAX_HUD_CACHE_ENTRIES 192
70 .tc = { 0x800, 0x800 },
186 if (
entry->id == -1) {
204 }
else if (
entry->id == raster) {
222 if (
entry->id == -1) {
240 }
else if (
entry->id == palette) {
264 s32 widthScale, heightScale;
268 s32 uly, lry, ulx, lrx;
275 u16 renderPosX, renderPosY;
292 baseX = offsetX + renderPosX;
293 baseY = offsetY + renderPosY;
377 lry = uly + 1024.0 / heightScale * 32.0;
409 lrx = ulx + 1024.0 / widthScale * 64.0;
465 gDPLoadTextureTile(
gMainGfxPos++, imageAddr,
G_IM_FMT_RGBA,
G_IM_SIZ_32b,
texSizeX,
texSizeY,
uls,
ult,
lrs,
lrt, 0,
468 gDPLoadTextureTile(
gMainGfxPos++, imageAddr,
G_IM_FMT_RGBA,
G_IM_SIZ_32b,
texSizeX,
texSizeY,
uls,
ult,
lrs,
lrt, 0,
493 gDPLoadTextureTile_4b(
gMainGfxPos++, imageAddr,
G_IM_FMT_CI,
texSizeX,
texSizeY,
uls,
ult,
lrs,
lrt, 0,
498 gDPLoadTextureTile_4b(
gMainGfxPos++, imageAddr,
G_IM_FMT_CI,
texSizeX,
texSizeY,
uls,
ult,
lrs,
lrt, 0,
502 gDPLoadTextureTile_4b(
gMainGfxPos++, imageAddr,
G_IM_FMT_CI,
texSizeX,
texSizeY,
uls,
ult,
lrs,
lrt, 0,
506 gDPLoadTextureTile_4b(
gMainGfxPos++, imageAddr,
G_IM_FMT_CI,
texSizeX,
texSizeY,
uls,
ult,
lrs,
lrt, 0,
510 gDPLoadTextureTile_4b(
gMainGfxPos++, imageAddr,
G_IM_FMT_CI,
texSizeX,
texSizeY,
uls,
ult,
lrs,
lrt, 0,
516 gDPLoadTextureTile_4b(
gMainGfxPos++, imageAddr,
G_IM_FMT_CI,
texSizeX,
texSizeY,
uls,
ult,
lrs,
lrt, 0,
528 gDPLoadTextureTile(
gMainGfxPos++, imageAddr,
G_IM_FMT_IA,
G_IM_SIZ_8b,
texSizeX,
texSizeY,
uls,
ult,
lrs,
lrt, 0,
532 gDPLoadTextureTile(
gMainGfxPos++, imageAddr,
G_IM_FMT_IA,
G_IM_SIZ_8b,
texSizeX,
texSizeY,
uls,
ult,
lrs,
lrt, 0,
536 gDPLoadTextureTile(
gMainGfxPos++, imageAddr,
G_IM_FMT_IA,
G_IM_SIZ_8b,
texSizeX,
texSizeY,
uls,
ult,
lrs,
lrt, 0,
540 gDPLoadTextureTile(
gMainGfxPos++, imageAddr,
G_IM_FMT_IA,
G_IM_SIZ_8b,
texSizeX,
texSizeY,
uls,
ult,
lrs,
lrt, 0,
545 gDPLoadTextureTile(
gMainGfxPos++, imageAddr,
G_IM_FMT_IA,
G_IM_SIZ_8b,
texSizeX,
texSizeY,
uls,
ult,
lrs,
lrt, 0,
549 gDPLoadTextureTile(
gMainGfxPos++, imageAddr,
G_IM_FMT_IA,
G_IM_SIZ_8b,
texSizeX,
texSizeY,
uls,
ult,
lrs,
lrt, 0,
563 ulx += 1024.0 / widthScale * 64.0;
572 uly += 1024.0 / heightScale * 32.0;
624 (*gHudElements)[i] =
NULL;
765 if (
elem->updateTimer == 0) {
769 elem->dynamicSize.x +=
elem->deltaSize.x;
770 elem->dynamicSize.y +=
elem->deltaSize.y;
793 switch (*nextPos++) {
995 tileSizePreset = *nextPos++;
996 drawSizePreset = *nextPos++;
1020 tileSizePreset = *nextPos++;
1021 drawSizePreset = *nextPos++;
1058 uniformScale = (
f32)*nextPos++;
1059 uniformScale /= 65536;
1138 hudTransform->
pivot.
x = arg1;
1139 hudTransform->
pivot.
y = arg2;
1166 elem = (*gHudElements)[i];
1200 for (i = 0; i < count - 1; i++) {
1201 for (
j = i + 1;
j < count;
j++) {
1204 if ((*
gHudElements)[
el1]->worldPosOffset.z < (*gHudElements)[
el2]->worldPosOffset.z) {
1212 for (i = 0; i < count; i++) {
1267 offsetX = -
elem->dynamicSize.x / 2;
1268 offsetY = -
elem->dynamicSize.y / 2;
1300 elem = (*gHudElements)[i];
1330 for (i = 0; i < count - 1; i++) {
1331 for (
j = i + 1;
j < count;
j++) {
1334 if ((*
gHudElements)[
el1]->worldPosOffset.z < (*gHudElements)[
el2]->worldPosOffset.z) {
1342 for (i = 0; i < count; i++) {
1395 offsetX = -
elem->dynamicSize.x / 2;
1396 offsetY = -
elem->dynamicSize.y / 2;
1456 width =
elem->customImageSize.x;
1457 height =
elem->customImageSize.y;
1463 transform =
elem->hudTransform;
1469 transform->
pos.
x +
elem->worldPosOffset.x +
elem->renderPosX +
elem->screenPosOffset.x,
1470 transform->
pos.
y +
elem->worldPosOffset.y -
elem->renderPosY -
elem->screenPosOffset.y,
1471 transform->
pos.
z - (
elem->worldPosOffset.z / 10.0)
1516 palette =
elem->paletteAddr;
1519 ifxImg.xOffset = -width / 2;
1520 ifxImg.yOffset = height / 2;
1522 ifxImg.palette = palette;
1542 vtx[0].v.ob[0] = -width / 2;
1543 vtx[0].v.ob[1] = -height / 2;
1546 vtx[0].v.tc[1] = height * 32;
1548 vtx[1].v.ob[0] = (width / 2) - 1;
1549 vtx[1].v.ob[1] = -height / 2;
1551 vtx[1].v.tc[0] = width * 32;
1552 vtx[1].v.tc[1] = height * 32;
1554 vtx[2].v.ob[0] = (width / 2) - 1;
1555 vtx[2].v.ob[1] = (height / 2) - 1;
1557 vtx[2].v.tc[0] = width * 32;
1560 vtx[3].v.ob[0] = -width / 2;
1561 vtx[3].v.ob[1] = (height / 2) - 1;
1608 elem = (*gHudElements)[i];
1649 for (i = 0; i < count - 1; i++) {
1650 for (
j = i + 1;
j < count;
j++) {
1654 if ((*
gHudElements)[
el1]->worldPosOffset.z < (*gHudElements)[
el2]->worldPosOffset.z) {
1684 for (i = 0; i < count; i++) {
1703 for (i = 0; i < count; i++) {
1743 guOrthoF(
camera->mtxPerspective, 0.0f, 320.0f, -240.0f, 0.0f, -1000.0f, 1000.0f, 1.0f);
1820 s32 offsetX, offsetY;
1830 if (
elem->drawSizePreset >= 0) {
1897 offsetX = -
elem->dynamicSize.x / 2;
1898 offsetY = -
elem->dynamicSize.y / 2;
2102 if (opacity == 255) {
2119 element->hudTransform = transform;
2123 transform->
pos.
x = 0.0f;
2124 transform->
pos.
y = 0.0f;
2125 transform->
pos.
z = 0.0f;
2126 transform->
rot.
x = 0.0f;
2127 transform->
rot.
y = 0.0f;
2128 transform->
rot.
z = 0.0f;
2129 transform->
scale.
x = 1.0f;
2130 transform->
scale.
y = 1.0f;
2131 transform->
scale.
z = 1.0f;
2141 element->hudTransform = transform;
2145 transform->
pos.
x = 0.0f;
2146 transform->
pos.
y = 0.0f;
2147 transform->
pos.
z = 0.0f;
2148 transform->
rot.
x = 0.0f;
2149 transform->
rot.
y = 0.0f;
2150 transform->
rot.
z = 0.0f;
2151 transform->
scale.
x = 1.0f;
2152 transform->
scale.
y = 1.0f;
2153 transform->
scale.
z = 1.0f;
2161 element->hudTransform = transform;
2165 transform->
pos.
x = 0.0f;
2166 transform->
pos.
y = 0.0f;
2167 transform->
pos.
z = 0.0f;
2168 transform->
rot.
x = 0.0f;
2169 transform->
rot.
y = 0.0f;
2170 transform->
rot.
z = 0.0f;
2171 transform->
scale.
x = 1.0f;
2172 transform->
scale.
y = 1.0f;
2173 transform->
scale.
z = 1.0f;
2195 transform->
pos.
x = x;
2196 transform->
pos.
y = y;
2197 transform->
pos.
z = z;
2217 transform->
rot.
x = x;
2218 transform->
rot.
y = y;
2219 transform->
rot.
z = z;
BSS s32 PopupMenu_SelectedIndex
#define general_heap_malloc
#define ASSERT(condition)
@ CAMERA_FLAG_LEAD_PLAYER
s32 imgfx_appendGfx_component(s32, ImgFXTexture *, u32, Matrix4f)
s32 imgfx_get_free_instances(s32)
s32 general_heap_free(void *data)
void imgfx_release_instance(u32)
void imgfx_update(u32, ImgFXType, s32, s32, s32, s32, s32)
void * heap_malloc(s32 size)
void set_cam_viewport(s16 id, s16 x, s16 y, s16 width, s16 height)
BSS HudCacheEntry gHudElementCacheTablePaletteWorld[192]
void hud_element_draw_complex_hud_next(s32 hid)
void hud_element_setup_cam(void)
u8 * gHudElementCacheBuffer
void hud_element_create_transform_C(s32 id)
void hud_element_get_render_pos(s32 id, s32 *x, s32 *y)
void hud_element_set_aux_cache(void *base, s32 size)
HudCacheEntry * gHudElementCacheTablePalette
BSS HudCacheEntry gHudElementCacheTableRasterWorld[192]
void hud_element_draw_complex_battle_first(s32 hid)
void hud_element_create_transform_A(s32 id)
void hud_element_set_scale(s32 index, f32 scale)
void hud_element_set_alpha(s32 id, s32 opacity)
HudElementSize HudElemSizes[]
void render_hud_elements_frontUI(void)
BSS HudElementList * gHudElements
s32 hud_element_update(HudElement *hudElement)
s32 * gHudElementCacheSize
void hud_element_draw_without_clipping(s32 id)
void hud_element_set_script(s32 id, HudScript *anim)
void update_hud_elements(void)
void hud_element_set_variable(s32 id, s32 value)
Vtx HudElemTemplateQuad[]
void render_hud_elements_backUI(void)
HudCacheEntry * gHudElementCacheTableRaster
void hud_element_draw_complex_battle_next(s32 hid)
#define MAX_HUD_CACHE_ENTRIES
BSS u8 * gHudElementCacheBufferWorld
void hud_element_set_render_depth(s32 id, s32 z)
void hud_element_create_transform_B(s32 id)
void immediately_render_complex_hud_element(s32 elemID, b32 includeSetup, s32 camID)
HudScript * hud_element_get_script(s32 id)
Gfx HudElemFrontInitGfx[]
BSS HudElementList gHudElementsWorld
void hud_element_set_transform_pos(s32 id, f32 x, f32 y, f32 z)
void hud_element_clear_cache(void)
void hud_element_draw_rect(HudElement *hudElement, s16 texSizeX, s16 texSizeY, s16 drawSizeX, s16 drawSizeY, s16 offsetX, s16 offsetY, s32 clamp, s32 dropShadow)
BSS s32 gHudElementCacheSizeBattle
void hud_element_draw_next(s32 id)
void init_hud_element_list(void)
void hud_element_set_tint(s32 id, s32 r, s32 g, s32 b)
BSS HudElementList gHudElementsBattle
void render_complex_hud_element(HudElement *elem)
void hud_element_set_transform_rotation(s32 id, f32 x, f32 y, f32 z)
void hud_element_use_preset_size(s32 id, s8 sizePreset)
BSS s32 gHudElementCacheSizeWorld
BSS HudCacheEntry gHudElementCacheTableRasterBattle[192]
void hud_element_draw_complex_hud_first(s32 hid)
BSS u8 * gHudElementCacheBufferBattle
void hud_element_set_render_pos(s32 id, s32 x, s32 y)
void hud_element_set_transform_rotation_pivot(s32 id, s32 dx, s32 dy)
s32 hud_element_create(HudScript *anim)
Creates a new HUD element and returns its ID.
void hud_element_load_script(HudElement *hudElement, HudScript *anim)
BSS HudCacheEntry gHudElementCacheTablePaletteBattle[192]
HudElement * get_hud_element(s32 id)
void hud_element_set_flags(s32 id, s32 flags)
Turns on the given flags.
void hud_element_clear_flags(s32 id, s32 flags)
Turns off the given flags.
s32 hud_element_get_variable(s32 id)
void hud_element_draw_clipped(s32 id)
void hud_element_set_transform_scale(s32 id, f32 x, f32 y, f32 z)
void hud_element_free(s32 id)
void render_transformed_hud_elements(void)
s32 gather_and_sort_hud_elements(s32 *sortedElements, b32 isBattle)
void hud_element_free_transform(s32 id)
void copy_world_hud_element_ref_to_battle(s32 worldID, s32 battleID)
void draw_hud_element_internal(s32 id, s32 clipMode)
void ALT_clear_hud_element_cache(void)
@ HUD_ELEMENT_DRAW_FIRST_WITH_CLIPPING
@ HUD_ELEMENT_DRAW_FIRST_WITHOUT_CLIPPING
@ HUD_ELEMENT_OP_SetPivot
@ HUD_ELEMENT_OP_SetVisible
@ HUD_ELEMENT_OP_AddTexelOffsetY
@ HUD_ELEMENT_OP_SetScale
@ HUD_ELEMENT_OP_SetImage
@ HUD_ELEMENT_OP_RandomBranch
@ HUD_ELEMENT_OP_PlaySound
@ HUD_ELEMENT_OP_SetSizesAutoScale
@ HUD_ELEMENT_OP_SetTexelOffset
@ HUD_ELEMENT_OP_RandomDelay
@ HUD_ELEMENT_OP_SetFlags
@ HUD_ELEMENT_OP_SetAlpha
@ HUD_ELEMENT_OP_SetTileSize
@ HUD_ELEMENT_OP_SetSizesFixedScale
@ HUD_ELEMENT_OP_RandomRestart
@ HUD_ELEMENT_OP_SetCustomSize
@ HUD_ELEMENT_OP_AddTexelOffsetX
@ HUD_ELEMENT_OP_SetVariable
@ HUD_ELEMENT_OP_ClearFlags
@ HUD_ELEMENT_OP_SetHidden
#define HUD_ELEMENT_BATTLE_ID_MASK
HudElement * HudElementList[320]
@ HUD_ELEMENT_FLAG_ANTIALIASING
@ HUD_ELEMENT_FLAG_DELETE
@ HUD_ELEMENT_FLAG_DISABLED
@ HUD_ELEMENT_FLAG_INVISIBLE
@ HUD_ELEMENT_FLAG_SCALED
@ HUD_ELEMENT_FLAG_MEMOFFSET
@ HUD_ELEMENT_FLAG_FMT_IA8
@ HUD_ELEMENT_FLAG_BATTLE_CAM
@ HUD_ELEMENT_FLAG_CUSTOM_SIZE
@ HUD_ELEMENT_FLAG_REPEATED
@ HUD_ELEMENT_FLAG_INITIALIZED
@ HUD_ELEMENT_FLAG_HIDDEN
@ HUD_ELEMENT_FLAG_DROP_SHADOW
@ HUD_ELEMENT_FLAG_RESIZING
@ HUD_ELEMENT_FLAG_MANUAL_RENDER
@ HUD_ELEMENT_FLAG_NO_FOLD
@ HUD_ELEMENT_FLAG_RESIZE_DIR
@ HUD_ELEMENT_FLAG_ANIMATION_FINISHED
@ HUD_ELEMENT_FLAG_BATTLE
@ HUD_ELEMENT_FLAG_FRONTUI
@ HUD_ELEMENT_FLAG_FMT_CI4
@ HUD_ELEMENT_FLAG_TRANSFORM
@ HUD_ELEMENT_FLAG_FILTER_TEX
@ HUD_ELEMENT_FLAG_TRANSPARENT
void sfx_play_sound(s32 soundID)
#define X10(f)
X.10 fixed-point literal.
#define VIRTUAL_TO_PHYSICAL(addr)
u8 Addr[]
Linker symbol address, as in ld_addrs.h.
GameStatus * gGameStatusPtr
DisplayContext * gDisplayContext