Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
cam_main.c File Reference

Go to the source code of this file.

Functions

void render_models (void)
 
void execute_render_tasks (void)
 
void render_item_entities (void)
 
void update_cameras (void)
 
void render_frame (s32 isSecondPass)
 
void create_cameras (void)
 
Camerainitialize_next_camera (CameraInitData *initData)
 
void set_cam_viewport (s16 id, s16 x, s16 y, s16 width, s16 height)
 
void get_cam_viewport (s32 camID, u16 *x, u16 *y, u16 *width, u16 *height)
 
void get_screen_coords (s32 camID, f32 x, f32 y, f32 z, s32 *screenX, s32 *screenY, s32 *screenZ)
 
b32 is_outside_cam_viewport_bounds (s32 camID, s32 x, s32 y)
 
void get_cam_viewport_bounds (s32 camID, s32 *x, s32 *y, s32 *width, s32 *height)
 

Variables

f32 CamLengthScale
 
s16 gCurrentCamID
 
u16 * nuGfxCfb_ptr
 
Gfx * gMainGfxPos
 
DisplayContextgDisplayContext
 
Camera gCameras [4]
 

Function Documentation

◆ render_models()

void render_models ( void )

Definition at line 2710 of file model.c.

2710 {
2711 RenderTask rt;
2712 RenderTask* rtPtr = &rt;
2713 f32 outX, outY, outZ, outW;
2714 f32 m00, m01, m02, m03;
2715 f32 m10, m11, m12, m13;
2716 f32 m20, m21, m22, m23;
2717 f32 m30, m31, m32, m33;
2718 f32 centerX, centerY, centerZ;
2719 f32 bbx, bby, bbz;
2720
2721 Camera* camera = &gCameras[gCurrentCameraID];
2722 Model* model;
2723 ModelBoundingBox* boundingBox;
2724 ModelTransformGroup* transformGroup;
2725 f32 xComp, yComp, zComp;
2726
2727 s32 distance;
2728 s32 notVisible;
2729 s32 i;
2730
2731#define TEST_POINT_VISIBILITY \
2732 outX = (m00 * xComp) + (m10 * yComp) + (m20 * zComp) + m30; \
2733 outY = (m01 * xComp) + (m11 * yComp) + (m21 * zComp) + m31; \
2734 outZ = (m02 * xComp) + (m12 * yComp) + (m22 * zComp) + m32; \
2735 outW = (m03 * xComp) + (m13 * yComp) + (m23 * zComp) + m33; \
2736 if (outW == 0.0f) { \
2737 break; \
2738 } \
2739 /* Perspective divide */ \
2740 outW = 1.0f / outW; \
2741 xComp = outX * outW; \
2742 yComp = outY * outW; \
2743 zComp = outZ * outW; \
2744 if (zComp > -1.0f && xComp >= -1.0f && xComp <= 1.0f && yComp >= -1.0f && yComp <= 1.0f) { \
2745 break; \
2746 }
2747
2748 m00 = camera->mtxPerspective[0][0];
2749 m01 = camera->mtxPerspective[0][1];
2750 m02 = camera->mtxPerspective[0][2];
2751 m03 = camera->mtxPerspective[0][3];
2752 m10 = camera->mtxPerspective[1][0];
2753 m11 = camera->mtxPerspective[1][1];
2754 m12 = camera->mtxPerspective[1][2];
2755 m13 = camera->mtxPerspective[1][3];
2756 m20 = camera->mtxPerspective[2][0];
2757 m21 = camera->mtxPerspective[2][1];
2758 m22 = camera->mtxPerspective[2][2];
2759 m23 = camera->mtxPerspective[2][3];
2760 m30 = camera->mtxPerspective[3][0];
2761 m31 = camera->mtxPerspective[3][1];
2762 m32 = camera->mtxPerspective[3][2];
2763 m33 = camera->mtxPerspective[3][3];
2764
2765 // enqueue all visible models not in transform groups
2766 for (i = 0; i < ARRAY_COUNT(*gCurrentModels); i++) {
2767 model = (*gCurrentModels)[i];
2768 if (model == NULL) {
2769 continue;
2770 }
2771 if (model->flags == 0) {
2772 continue;
2773 }
2774 if (model->flags & MODEL_FLAG_INACTIVE) {
2775 continue;
2776 }
2777 if (model->flags & MODEL_FLAG_HIDDEN) {
2778 continue;
2779 }
2780 if (model->flags & MODEL_FLAG_20) {
2781 continue;
2782 }
2784 continue;
2785 }
2786
2787 centerX = model->center.x;
2788 centerY = model->center.y;
2789 centerZ = model->center.z;
2790
2791 // for models that are small enough to do bounds culling, only render if at least one
2792 // corner of its boundary box is visible
2793 if (model->flags & MODEL_FLAG_DO_BOUNDS_CULLING) {
2794 notVisible = FALSE;
2795 boundingBox = (ModelBoundingBox*) model->modelNode->propertyList;
2796 bbx = boundingBox->halfSizeX;
2797 bby = boundingBox->halfSizeY;
2798 bbz = boundingBox->halfSizeZ;
2799
2800 while (TRUE) {
2801 if (TRUE) {
2802 xComp = centerX - bbx;
2803 yComp = centerY - bby;
2804 zComp = centerZ - bbz;
2806 }
2807
2808 if (bbx != 0.0f) {
2809 xComp = centerX + bbx;
2810 yComp = centerY - bby;
2811 zComp = centerZ - bbz;
2813 }
2814
2815 if (bby != 0.0f) {
2816 xComp = centerX - bbx;
2817 yComp = centerY + bby;
2818 zComp = centerZ - bbz;
2820 }
2821
2822 if (bbx != 0.0f && bby != 0.0f) {
2823 xComp = centerX + bbx;
2824 yComp = centerY + bby;
2825 zComp = centerZ - bbz;
2827 }
2828
2829 if (bbz != 0.0f) {
2830 xComp = centerX - bbx;
2831 yComp = centerY - bby;
2832 zComp = centerZ + bbz;
2834 }
2835
2836 if (bbx != 0.0f && bbz != 0.0f) {
2837 xComp = centerX + bbx;
2838 yComp = centerY - bby;
2839 zComp = centerZ + bbz;
2841 }
2842
2843 if (bby != 0.0f && bbz != 0.0f) {
2844 xComp = centerX - bbx;
2845 yComp = centerY + bby;
2846 zComp = centerZ + bbz;
2848 }
2849
2850 if (bbx != 0.0f && bby != 0.0f && bbz != 0.0f) {
2851 xComp = centerX + bbx;
2852 yComp = centerY + bby;
2853 zComp = centerZ + bbz;
2855 }
2856 notVisible = TRUE;
2857 break;
2858 }
2859 // no points of the models bounding box were visible
2860 if (notVisible) {
2861 continue;
2862 }
2863 }
2864
2865 // map all model depths to the interval [0, 10k] and submit render task
2866 transform_point(camera->mtxPerspective, centerX, centerY, centerZ, 1.0f, &outX, &outY, &outZ, &outW);
2867 distance = outZ + 5000.0f;
2868 if (distance < 0) {
2869 distance = 0;
2870 } else if (distance > 10000) {
2871 distance = 10000;
2872 }
2873 rtPtr->appendGfxArg = model;
2874 if (model->modelNode->type == SHAPE_TYPE_GROUP) {
2876 } else {
2877 rtPtr->appendGfx = appendGfx_model;
2878 }
2879 rtPtr->dist = -distance;
2880 rtPtr->renderMode = model->renderMode;
2881 queue_render_task(rtPtr);
2882 }
2883
2884 // enqueue models in transform groups
2885 // only the center of the group is used for depth sorting
2886 for (i = 0; i < ARRAY_COUNT(*gCurrentTransformGroups); i++) {
2887 transformGroup = (*gCurrentTransformGroups)[i];
2888 if (transformGroup == NULL) {
2889 continue;
2890 }
2891
2892 if (transformGroup->flags == 0) {
2893 continue;
2894 }
2895
2896 if (transformGroup->flags & TRANSFORM_GROUP_FLAG_INACTIVE) {
2897 continue;
2898 }
2899
2900 xComp = transformGroup->center.x;
2901 yComp = transformGroup->center.y;
2902 zComp = transformGroup->center.z;
2903
2905 camera->mtxPerspective,
2906 xComp, yComp, zComp, 1.0f,
2907 &outX, &outY, &outZ, &outW
2908 );
2909 if (outW == 0.0f) {
2910 outW = 1.0f;
2911 }
2912
2913 distance = ((outZ / outW) * 10000.0f);
2914
2915 if (!(transformGroup->flags & TRANSFORM_GROUP_FLAG_HIDDEN)) {
2917 rtPtr->appendGfxArg = transformGroup;
2918 rtPtr->dist = -distance;
2919 rtPtr->renderMode = transformGroup->renderMode;
2920 queue_render_task(rtPtr);
2921 }
2922 }
2923}
#define transform_point
#define queue_render_task
@ TRANSFORM_GROUP_FLAG_INACTIVE
Definition enums.h:5082
@ TRANSFORM_GROUP_FLAG_HIDDEN
Definition enums.h:5081
@ MODEL_FLAG_DO_BOUNDS_CULLING
Definition enums.h:4366
@ MODEL_FLAG_INACTIVE
Definition enums.h:4359
@ MODEL_FLAG_HIDDEN
Definition enums.h:4358
@ MODEL_FLAG_20
Definition enums.h:4362
@ MODEL_FLAG_TRANSFORM_GROUP_MEMBER
Definition enums.h:4360
void render_transform_group(void *group)
Definition model.c:3034
void appendGfx_model_group(void *model)
Definition model.c:2925
ModelTransformGroupList * gCurrentTransformGroups
Definition model.c:1309
ModelList * gCurrentModels
Definition model.c:106
void appendGfx_model(void *data)
Definition model.c:1368
#define TEST_POINT_VISIBILITY
ModelNodeProperty * propertyList
Definition model.h:55
s8 renderMode
Definition model.h:72
Vec3f center
Definition model.h:69
ModelNode * modelNode
Definition model.h:63
s32 type
Definition model.h:52
u16 flags
Definition model.h:60
@ SHAPE_TYPE_GROUP
Definition model.h:153
Definition model.h:59
#define ARRAY_COUNT(arr)
Definition macros.h:40
Matrix4f mtxPerspective
void * appendGfxArg
void(* appendGfx)(void *)
Camera gCameras[4]
Definition cam_main.c:17
s32 gCurrentCameraID
Definition cam_math.c:4

Referenced by render_frame().

◆ execute_render_tasks()

void execute_render_tasks ( void )

Definition at line 4572 of file model.c.

4572 {
4573 s32 i, j;
4575 s32* sorted;
4576 RenderTask* taskList;
4577 RenderTask* task;
4578 RenderTask* task2;
4579 Matrix4f mtxFlipY;
4580 void (*appendGfx)(void*);
4581 s32 tmp;
4582
4583 for (s32 j = 0; j < ARRAY_COUNT(RenderTaskCount); j++) {
4584 for (i = 0; i < RenderTaskCount[j]; i++) {
4585 sorteds[j][i] = i;
4586 }
4587 }
4588
4589 // sort in ascending order of dist
4591 sorted = &sorteds[RENDER_TASK_LIST_MID];
4592#define LESS(i, j) taskList[sorted[i]].dist < taskList[sorted[j]].dist
4593#define SWAP(i, j) tmp = sorted[i], sorted[i] = sorted[j], sorted[j] = tmp
4595
4596 // tasks with dist >= 3M sort in descending order
4598 sorted = &sorteds[RENDER_TASK_LIST_FAR];
4599#define LESS(i, j) taskList[sorted[i]].dist > taskList[sorted[j]].dist
4601
4602 // tasks with dist <= 800k sort in descending order
4604 sorted = &sorteds[RENDER_TASK_LIST_NEAR];
4606
4609 Mtx* dispMtx;
4610 Gfx* savedGfxPos = NULL;
4611
4612 guScaleF(mtxFlipY, 1.0f, -1.0f, 1.0f);
4615 for (j = 0; j < NUM_RENDER_TASK_LISTS; j++) {
4616 for (i = 0; i < RenderTaskCount[j]; i++) {
4617 task = &RenderTaskLists[j][sorteds[j][i]];
4618 appendGfx = task->appendGfx;
4619
4621 savedGfxPos = gMainGfxPos++;
4622 }
4623
4624 appendGfx(task->appendGfxArg);
4625
4627 gSPEndDisplayList(gMainGfxPos++);
4628 gSPBranchList(savedGfxPos, gMainGfxPos);
4629 gSPDisplayList(gMainGfxPos++, savedGfxPos + 1);
4630 gSPMatrix(gMainGfxPos++, dispMtx, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION);
4631 gSPDisplayList(gMainGfxPos++, savedGfxPos + 1);
4632 gSPMatrix(gMainGfxPos++, &gDisplayContext->camPerspMatrix[gCurrentCamID], G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
4633 }
4634 }
4635 }
4636 } else {
4637 for (j = 0; j < NUM_RENDER_TASK_LISTS; j++) {
4638 for (i = 0; i < RenderTaskCount[j]; i++) {
4639 task = &RenderTaskLists[j][sorteds[j][i]];
4640 appendGfx = task->appendGfx;
4641 appendGfx(task->appendGfxArg);
4642 }
4643 }
4644 }
4645
4649}
Mtx matrixStack[0x200]
f32 Matrix4f[4][4]
#define guMtxF2L
#define guScaleF
@ RENDER_TASK_FLAG_REFLECT_FLOOR
Definition enums.h:3318
@ GLOBAL_OVERRIDES_ENABLE_FLOOR_REFLECTION
Definition enums.h:4326
#define SWAP(i, j)
BSS s32 RenderTaskCount[3]
Definition model.c:1353
s32 gLastRenderTaskCount
Definition model.c:636
BSS RenderTask * RenderTaskLists[3]
Definition model.c:1351
@ RENDER_TASK_LIST_FAR
Definition model.c:99
@ RENDER_TASK_LIST_NEAR
Definition model.c:97
@ RENDER_TASK_LIST_MID
Definition model.c:98
#define LESS(i, j)
BSS RenderTask ClearRenderTaskLists[3][0x100]
#define NUM_RENDER_TASK_LISTS
#define QSORT(Q_N, Q_LESS, Q_SWAP)
Definition qsort.h:161
s32 gOverrideFlags
Definition main_loop.c:11
Gfx * gMainGfxPos
Definition cam_main.c:15
u16 gMatrixListPos
Definition main_loop.c:45
DisplayContext * gDisplayContext
Definition cam_main.c:16
s16 gCurrentCamID
Definition cam_main.c:13

Referenced by render_frame().

◆ render_item_entities()

void render_item_entities ( void )

Definition at line 1118 of file item_entity.c.

1118 {
1119 s32 i;
1120 s32 offsetY;
1121 f32 rotX;
1122 Mtx sp18;
1123 Matrix4f sp58;
1124 Matrix4f sp98;
1125 Matrix4f spD8;
1126 u8 r1, g1, b1, a1;
1127 s32 alpha;
1128
1129 // needed to move 'i++' to the bottom
1130 for (i = 0; i < MAX_ITEM_ENTITIES;) {
1132 if (item != NULL) {
1133 if ((item->flags != 0)) {
1134 if (!(item->flags & ITEM_ENTITY_FLAG_HIDDEN)) {
1135 if ((item->flags & ITEM_ENTITY_FLAG_INVISIBLE)) {
1136 if (!(item->flags & ITEM_ENTITY_FLAG_FULLSIZE)) {
1137 offsetY = -4;
1138 } else {
1139 offsetY = 0;
1140 }
1141
1142 if (item->itemID == ITEM_COIN || item->itemID == ITEM_STAR_POINT || item->itemID == ITEM_HEART) {
1143 offsetY = 0;
1144 item->scale = 1.0f;
1145 }
1146
1147 rotX = clamp_angle(180.0f - gCameras[gCurrentCamID].curYaw);
1148 guTranslateF(sp58, item->pos.x, -item->pos.y - offsetY, item->pos.z);
1149 guRotateF(sp98, rotX, 0.0f, 1.0f, 0.0f);
1150 if (item->flags & ITEM_ENTITY_RESIZABLE) {
1151 guScaleF(spD8, item->scale, item->scale, item->scale);
1152 guMtxCatF(sp98, spD8, sp98);
1153 }
1154 guMtxCatF(sp98, sp58, sp58);
1155 guMtxF2L(sp58, &sp18);
1157 gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
1158
1159 if (gSpriteShadingProfile->flags != 0) {
1160 gSPDisplayList(gMainGfxPos++, Gfx_RM2_ALPHATEST);
1161 } else {
1162 gSPDisplayList(gMainGfxPos++, Gfx_RM1_ALPHATEST);
1163 }
1164 gSPClearGeometryMode(gMainGfxPos++, G_LIGHTING);
1165 gSPDisplayList(gMainGfxPos++, D_8014C620);
1166
1167 alpha = 255;
1169 if (item->flags & ITEM_ENTITY_FLAG_TRANSPARENT) {
1170 alpha = item->alpha * alpha / 255;
1171 }
1172 if (item->flags & ITEM_ENTITY_FLAG_HIDING) {
1173 mdl_get_shroud_tint_params(&r1, &g1, &b1, &a1);
1174 alpha = alpha * (255 - a1) / 255;
1175 }
1177 if (gSpriteShadingProfile->flags != 0) {
1178 gDPSetRenderMode(gMainGfxPos++, AA_EN | IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | G_RM_PASS,
1179 AA_EN | IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA));
1180 } else {
1181 gDPSetRenderMode(gMainGfxPos++, AA_EN | IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA),
1182 AA_EN | IM_RD | CVG_DST_SAVE | ZMODE_OPA | FORCE_BL | GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA));
1183 gDPSetCombineMode(gMainGfxPos++, PM_CC_2F, PM_CC_32);
1184 gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, alpha);
1185 }
1186 }
1187 }
1188
1189 if (!(item->flags & ITEM_ENTITY_FLAG_FULLSIZE)) {
1190 gDPLoadTLUT_pal16(gMainGfxPos++, 0, gHudElementCacheTablePalette[item->lookupPaletteIndex].data);
1191 if (gSpriteShadingProfile->flags != 0) {
1192 gDPSetTextureImage(gMainGfxPos++, G_IM_FMT_CI, G_IM_SIZ_8b, 12, gHudElementCacheTableRaster[item->lookupRasterIndex].data);
1193 gDPSetTile(gMainGfxPos++, G_IM_FMT_CI, G_IM_SIZ_8b, 2, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD);
1194 gDPLoadSync(gMainGfxPos++);
1195 gDPLoadTile(gMainGfxPos++, G_TX_LOADTILE, 0, 0, 0x002E, 0x005C);
1196 gDPPipeSync(gMainGfxPos++);
1197 gDPSetTile(gMainGfxPos++, G_IM_FMT_CI, G_IM_SIZ_4b, 2, 0x0000, 1, 0, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD);
1198 gDPSetTileSize(gMainGfxPos++, 1, 0x0400, 0x0400, 0x045C, 0x045C);
1199 gDPSetTile(gMainGfxPos++, G_IM_FMT_CI, G_IM_SIZ_4b, 2, 0x0000, G_TX_RENDERTILE, 1, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD);
1200 gDPSetTile(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 4, 0x0100, 2, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
1201 gDPSetTileSize(gMainGfxPos++, 2, 0, 0, 0x00FC, 0);
1203 func_801491E4(sp58, 0, 0, 24, 24, alpha);
1204 } else {
1205 func_801491E4(sp58, 0, 0, 24, 24, 255);
1206 }
1207 } else {
1208 gDPSetTextureImage(gMainGfxPos++, G_IM_FMT_CI, G_IM_SIZ_8b, 12, gHudElementCacheTableRaster[item->lookupRasterIndex].data);
1209 gDPSetTile(gMainGfxPos++, G_IM_FMT_CI, G_IM_SIZ_8b, 2, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD);
1210 gDPLoadSync(gMainGfxPos++);
1211 gDPLoadTile(gMainGfxPos++, G_TX_LOADTILE, 0, 0, 0x002E, 0x005C);
1212 gDPPipeSync(gMainGfxPos++);
1213 gDPSetTile(gMainGfxPos++, G_IM_FMT_CI, G_IM_SIZ_4b, 2, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD);
1214 gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE, 0x0400, 0x0400, 0x045C, 0x045C);
1215 }
1216 gSPDisplayList(gMainGfxPos++, D_8014C678);
1217 } else {
1218 gDPLoadTLUT_pal16(gMainGfxPos++, 0, gHudElementCacheTablePalette[item->lookupPaletteIndex].data);
1219 if (gSpriteShadingProfile->flags != 0) {
1220 gDPSetTextureImage(gMainGfxPos++, G_IM_FMT_CI, G_IM_SIZ_8b, 16, gHudElementCacheTableRaster[item->lookupRasterIndex].data);
1221 gDPSetTile(gMainGfxPos++, G_IM_FMT_CI, G_IM_SIZ_8b, 2, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD);
1222 gDPLoadSync(gMainGfxPos++);
1223 gDPLoadTile(gMainGfxPos++, G_TX_LOADTILE, 0, 0, 0x003E, 0x007C);
1224 gDPPipeSync(gMainGfxPos++);
1225 gDPSetTile(gMainGfxPos++, G_IM_FMT_CI, G_IM_SIZ_4b, 2, 0x0000, 1, 0, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD);
1226 gDPSetTileSize(gMainGfxPos++, 1, 0x0400, 0x0400, 0x047C, 0x047C);
1227 gDPSetTile(gMainGfxPos++, G_IM_FMT_CI, G_IM_SIZ_4b, 2, 0x0000, G_TX_RENDERTILE, 1, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD);
1228 gDPSetTile(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 4, 0x0100, 2, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD);
1229 gDPSetTileSize(gMainGfxPos++, 2, 0, 0, 0x00FC, 0);
1231 func_801491E4(sp58, 0, 0, 32, 32, alpha);
1232 } else {
1233 func_801491E4(sp58, 0, 0, 32, 32, 255);
1234 }
1235 } else {
1236 gDPSetTextureImage(gMainGfxPos++, G_IM_FMT_CI, G_IM_SIZ_8b, 16, gHudElementCacheTableRaster[item->lookupRasterIndex].data);
1237 gDPSetTile(gMainGfxPos++, G_IM_FMT_CI, G_IM_SIZ_8b, 2, 0x0000, G_TX_LOADTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD);
1238 gDPLoadSync(gMainGfxPos++);
1239 gDPLoadTile(gMainGfxPos++, G_TX_LOADTILE, 0, 0, 0x003E, 0x007C);
1240 gDPPipeSync(gMainGfxPos++);
1241 gDPSetTile(gMainGfxPos++, G_IM_FMT_CI, G_IM_SIZ_4b, 2, 0x0000, G_TX_RENDERTILE, 0, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_CLAMP, 8, G_TX_NOLOD);
1242 gDPSetTileSize(gMainGfxPos++, G_TX_RENDERTILE, 0x0400, 0x0400, 0x047C, 0x047C);
1243 }
1244 gSPDisplayList(gMainGfxPos++, D_8014C6A0);
1245 }
1246 gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
1247 gDPPipeSync(gMainGfxPos++);
1248 }
1249 }
1250 }
1251 }
1252 i++;
1253 }
1254}
#define guRotateF
#define guTranslateF
#define guMtxCatF
#define clamp_angle
#define mdl_get_shroud_tint_params
@ ITEM_ENTITY_RESIZABLE
Definition enums.h:2708
@ ITEM_ENTITY_FLAG_HIDING
Definition enums.h:2721
@ ITEM_ENTITY_FLAG_FULLSIZE
Definition enums.h:2712
@ ITEM_ENTITY_FLAG_HIDDEN
Definition enums.h:2700
@ ITEM_ENTITY_FLAG_TRANSPARENT
Definition enums.h:2713
@ ITEM_ENTITY_FLAG_INVISIBLE
Definition enums.h:2714
void func_801491E4(Matrix4f mtx, s32, s32, s32, s32, s32 alpha)
Gfx D_8014C620[]
Definition item_entity.c:87
#define MAX_ITEM_ENTITIES
Definition item_entity.c:16
HudCacheEntry * gHudElementCacheTablePalette
Gfx D_8014C6A0[]
HudCacheEntry * gHudElementCacheTableRaster
Gfx Gfx_RM2_ALPHATEST[]
Definition model.c:905
Gfx D_8014C678[]
BSS ItemEntity ** gCurrentItemEntities
Definition item_entity.c:41
Gfx Gfx_RM1_ALPHATEST[]
Definition model.c:676
#define PM_CC_32
Definition macros.h:385
#define PM_CC_2F
Definition macros.h:384
SpriteShadingProfile * gSpriteShadingProfile

Referenced by render_frame().

◆ update_cameras()

void update_cameras ( void )

Definition at line 19 of file cam_main.c.

19 {
20 s32 sx, sy, sz;
21 s32 camID;
22
23 for (camID = 0; camID < ARRAY_COUNT(gCameras); camID++) {
24 Camera* cam = &gCameras[camID];
25
26 if (cam->flags == 0 || cam->flags & CAMERA_FLAG_DISABLED) {
27 continue;
28 }
29
30 gCurrentCamID = camID;
31
32 switch (cam->updateMode) {
33 default:
36 break;
39 break;
42 break;
45 break;
48 break;
51 break;
54 break;
55 }
56
57 guLookAtReflectF(cam->mtxViewPlayer, &gDisplayContext->lookAt, cam->lookAt_eye.x, cam->lookAt_eye.y, cam->lookAt_eye.z, cam->lookAt_obj.x, cam->lookAt_obj.y, cam->lookAt_obj.z, 0, 1.0f, 0);
58
59 if (!(cam->flags & CAMERA_FLAG_ORTHO)) {
60 if (cam->flags & CAMERA_FLAG_LEAD_PLAYER) {
62 }
63
64 guPerspectiveF(cam->mtxPerspective, &cam->perspNorm, cam->vfov, (f32) cam->viewportW / (f32) cam->viewportH, (f32) cam->nearClip, (f32) cam->farClip, 1.0f);
65
66 if (cam->flags & CAMERA_FLAG_SHAKING) {
68 }
69
70 if (cam->flags & CAMERA_FLAG_LEAD_PLAYER) {
72 }
73
75 } else {
76 f32 w = cam->viewportW;
77 f32 h = cam->viewportH;
78
79 guOrthoF(cam->mtxPerspective, -w * 0.5, w * 0.5, -h * 0.5, h * 0.5, -1000.0f, 1000.0f, 1.0f);
80 }
81
82 get_screen_coords(CAM_DEFAULT, cam->targetPos.x, cam->targetPos.y, cam->targetPos.z, &sx, &sy, &sz);
83 cam->targetScreenCoords.x = sx;
84 cam->targetScreenCoords.y = sy;
85 cam->targetScreenCoords.z = sz;
86 }
87
89}
void get_screen_coords(s32 camID, f32 x, f32 y, f32 z, s32 *screenX, s32 *screenY, s32 *screenZ)
Definition cam_main.c:410
Camera gCameras[4]
Definition cam_main.c:17
DisplayContext * gDisplayContext
Definition cam_main.c:16
s16 gCurrentCamID
Definition cam_main.c:13
void update_camera_zone_interp(Camera *camera)
void update_camera_no_interp(Camera *)
void update_camera_unused_radial(Camera *)
void create_camera_leadplayer_matrix(Camera *)
Definition cam_math.c:476
void update_camera_unused_confined(Camera *)
void update_camera_unused_leading(Camera *)
void update_camera_minimal(Camera *)
void update_camera_interp_pos(Camera *)
#define guOrthoF
#define guPerspectiveF
@ CAMERA_FLAG_DISABLED
Definition enums.h:4721
@ CAMERA_FLAG_LEAD_PLAYER
Definition enums.h:4722
@ CAMERA_FLAG_ORTHO
Definition enums.h:4724
@ CAMERA_FLAG_SHAKING
Definition enums.h:4723
@ CAM_UPDATE_MINIMAL
Definition enums.h:4741
@ CAM_UPDATE_NO_INTERP
Definition enums.h:4761
@ CAM_UPDATE_UNUSED_RADIAL
Definition enums.h:4765
@ CAM_UPDATE_FROM_ZONE
Definition enums.h:4755
@ CAM_UPDATE_UNUSED_CONFINED
Definition enums.h:4770
@ CAM_UPDATE_INTERP_POS
Definition enums.h:4747
@ CAM_UPDATE_UNUSED_LEADING
Definition enums.h:4775
@ CAM_DEFAULT
Definition enums.h:1800
Vec3f lookAt_obj
Vec3s targetScreenCoords
Matrix4f mtxViewLeading
Vec3f targetPos
Matrix4f mtxViewShaking
Vec3f lookAt_eye
Matrix4f mtxViewPlayer

Referenced by state_step_battle(), state_step_change_map(), state_step_enter_world(), state_step_game_over(), state_step_intro(), state_step_logos(), state_step_title_screen(), and state_step_world().

◆ render_frame()

void render_frame ( s32 isSecondPass)

Definition at line 91 of file cam_main.c.

91 {
92 s32 firstCamID;
93 s32 lastCamID;
94 s32 camID;
95
96 if (!isSecondPass) {
99 }
100
101 // first pass: loop uses camIDs from CAM_DEFAULT to CAM_HUD - 1
102 // second pass: loop only uses CAM_HUD
103 if (isSecondPass) {
104 firstCamID = CAM_HUD;
105 lastCamID = ARRAY_COUNT(gCameras);
106 } else {
107 firstCamID = CAM_DEFAULT;
108 lastCamID = CAM_HUD;
109 }
110
111 for (camID = firstCamID; camID < lastCamID; camID++) {
112 Camera* camera = &gCameras[camID];
113
114 if (camera->flags == 0 || (camera->flags & (CAMERA_FLAG_NO_DRAW | CAMERA_FLAG_DISABLED))) {
115 continue;
116 }
117
118 gCurrentCamID = camID;
119
120 if (camera->fpDoPreRender != NULL) {
121 camera->fpDoPreRender(camera);
122 } else {
123 s32 ulx;
124 s32 uly;
125 s32 lrx;
126 s32 lry;
127
128 gSPViewport(gMainGfxPos++, &camera->vp);
129 gSPClearGeometryMode(gMainGfxPos++, G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN |
130 G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH);
131 gSPTexture(gMainGfxPos++, 0, 0, 0, G_TX_RENDERTILE, G_OFF);
132 gDPSetCycleType(gMainGfxPos++, G_CYC_1CYCLE);
133 gDPPipelineMode(gMainGfxPos++, G_PM_NPRIMITIVE);
134
135 ulx = camera->viewportStartX;
136 uly = camera->viewportStartY;
137 lrx = ulx + camera->viewportW;
138 lry = uly + camera->viewportH;
139
140 if (ulx < 0) {
141 ulx = 0;
142 }
143 if (uly < 0) {
144 uly = 0;
145 }
146 if (lrx < 1) {
147 lrx = 1;
148 }
149 if (lry < 1) {
150 lry = 1;
151 }
152
153 if (ulx > SCREEN_WIDTH - 1) {
154 ulx = SCREEN_WIDTH - 1;
155 }
156 if (uly > SCREEN_HEIGHT - 1) {
157 uly = SCREEN_HEIGHT - 1;
158 }
159 if (lrx > SCREEN_WIDTH) {
160 lrx = SCREEN_WIDTH;
161 }
162 if (lry > SCREEN_HEIGHT) {
163 lry = SCREEN_HEIGHT;
164 }
165
166 gDPSetScissor(gMainGfxPos++, G_SC_NON_INTERLACE, ulx, uly, lrx, lry);
167 gDPSetTextureLOD(gMainGfxPos++, G_TL_TILE);
168 gDPSetTextureLUT(gMainGfxPos++, G_TT_NONE);
169 gDPSetTextureDetail(gMainGfxPos++, G_TD_CLAMP);
170 gDPSetTexturePersp(gMainGfxPos++, G_TP_PERSP);
171 gDPSetTextureFilter(gMainGfxPos++, G_TF_BILERP);
172 gDPSetTextureConvert(gMainGfxPos++, G_TC_FILT);
173 gDPSetCombineMode(gMainGfxPos++, G_CC_SHADE, G_CC_SHADE);
174 gDPSetCombineKey(gMainGfxPos++, G_CK_NONE);
175 gDPSetAlphaCompare(gMainGfxPos++, G_AC_NONE);
176 gDPSetRenderMode(gMainGfxPos++, G_RM_OPA_SURF, G_RM_OPA_SURF2);
177 gDPSetColorDither(gMainGfxPos++, G_CD_DISABLE);
178 gSPClipRatio(gMainGfxPos++, FRUSTRATIO_2);
179 gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH,
180 osVirtualToPhysical(nuGfxCfb_ptr));
181 gDPPipeSync(gMainGfxPos++);
182
183 if (!(camera->flags & CAMERA_FLAG_ORTHO)) {
184 gSPPerspNormalize(gMainGfxPos++, camera->perspNorm);
185 }
186
188 gSPMatrix(gMainGfxPos++, &gDisplayContext->camPerspMatrix[gCurrentCamID], G_MTX_NOPUSH | G_MTX_LOAD |
189 G_MTX_PROJECTION);
190 }
191
193 guRotate(camera->mtxBillboard, -camera->curBoomYaw, 0.0f, 1.0f, 0.0f);
194
195 camera->vpAlt.vp.vtrans[0] = camera->vp.vp.vtrans[0] + gGameStatusPtr->altViewportOffset.x;
196 camera->vpAlt.vp.vtrans[1] = camera->vp.vp.vtrans[1] + gGameStatusPtr->altViewportOffset.y;
197
198 if (!(camera->flags & CAMERA_FLAG_ORTHO)) {
199 if (gCurrentCamID != CAM_HUD) {
200 if (!(camera->flags & CAMERA_FLAG_RENDER_ENTITIES)) {
204 }
205 if (!(camera->flags & CAMERA_FLAG_RENDER_MODELS)) {
207 #if DX_DEBUG_MENU
208 if (!dx_debug_should_hide_models()) {
210 }
211 #else
213 #endif
215 }
219 render_npcs();
226 #if DX_DEBUG_MENU
227 dx_debug_draw_collision();
228 #endif
231 } else {
232 guOrthoF(camera->mtxPerspective, 0.0f, SCREEN_WIDTH, -SCREEN_HEIGHT, 0.0f, -1000.0f, 1000.0f, 1.0f);
234 gSPMatrix(gMainGfxPos++, &gDisplayContext->camPerspMatrix[gCurrentCamID], G_MTX_NOPUSH |
235 G_MTX_LOAD | G_MTX_PROJECTION);
238 }
239 } else {
242 }
243
244 if (camera->fpDoPostRender != NULL) {
245 camera->fpDoPostRender(camera);
246 }
247
248 gDPPipeSync(gMainGfxPos++);
249 gDPSetColorImage(gMainGfxPos++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH,
250 osVirtualToPhysical(nuGfxCfb_ptr));
251 gDPPipeSync(gMainGfxPos++);
252 }
253}
void execute_render_tasks(void)
Definition model.c:4572
Gfx * gMainGfxPos
Definition cam_main.c:15
void render_models(void)
Definition model.c:2710
void render_item_entities(void)
u16 * nuGfxCfb_ptr
Definition cam_main.c:14
Vec2b altViewportOffset
@ CAMERA_FLAG_RENDER_MODELS
Definition enums.h:4727
@ CAMERA_FLAG_NO_DRAW
Definition enums.h:4725
@ CAMERA_FLAG_RENDER_ENTITIES
Definition enums.h:4726
@ CAM_HUD
Definition enums.h:1803
void render_entities(void)
Definition entity.c:338
void render_effects_world(void)
Definition effects.c:112
void render_workers_world(void)
Definition worker.c:137
void render_player(void)
Definition 77480.c:1489
void mdl_update_transform_matrices(void)
Definition model.c:2589
void render_transformed_hud_elements(void)
void render_npcs(void)
Renders all NPCs.
Definition npc.c:933
#define GFX_PROFILER_SWITCH(complete, begin)
Definition profiling.h:212
@ PROFILER_TIME_SUB_GFX_HUD_ELEMENTS
Definition profiling.h:67
@ PROFILER_TIME_SUB_GFX_ENTITIES
Definition profiling.h:67
@ PROFILER_TIME_SUB_GFX_WORKERS
Definition profiling.h:67
@ PROFILER_TIME_SUB_GFX_PLAYER
Definition profiling.h:67
@ PROFILER_TIME_SUB_GFX_EFFECTS
Definition profiling.h:67
@ PROFILER_TIME_SUB_GFX_MODELS
Definition profiling.h:67
@ PROFILER_TIME_SUB_GFX_RENDER_TASKS
Definition profiling.h:67
@ PROFILER_TIME_SUB_GFX_NPCS
Definition profiling.h:67
#define GFX_PROFILER_COMPLETE(which)
Definition profiling.h:217
#define GFX_PROFILER_START(which)
Definition profiling.h:216
#define SCREEN_WIDTH
Definition macros.h:105
#define SCREEN_HEIGHT
Definition macros.h:106
Mtx * mtxBillboard
s16 viewportStartX
void(* fpDoPreRender)(struct Camera *)
s16 viewportStartY
void(* fpDoPostRender)(struct Camera *)
GameStatus * gGameStatusPtr
Definition main_loop.c:32

Referenced by appendGfx_title_screen(), and gfx_draw_frame().

◆ create_cameras()

void create_cameras ( void )

Definition at line 255 of file cam_main.c.

255 {
256 CameraInitData camData;
257 CameraInitData* camDataPtr = &camData;
258 s32 i;
259
260 CamLengthScale = 1.0f;
261
262 for (i = 0; i < ARRAY_COUNT(gCameras); i++) {
263 gCameras[i].flags = 0;
264 }
265
266 camDataPtr->flags = CAMERA_FLAG_DISABLED;
267 camDataPtr->updateMode = CAM_UPDATE_MINIMAL;
268 camDataPtr->viewWidth = 160;
269 camDataPtr->viewHeight = 120;
270 camDataPtr->viewStartX = 0;
271 camDataPtr->viewStartY = 0;
272 camDataPtr->nearClip = 8;
273 camDataPtr->farClip = 16384;
274 camDataPtr->vfov = 50;
275 initialize_next_camera(camDataPtr);
276
277 camDataPtr->flags = CAMERA_FLAG_DISABLED;
278 camDataPtr->updateMode = CAM_UPDATE_MINIMAL;
279 camDataPtr->viewWidth = 160;
280 camDataPtr->viewHeight = 120;
281 camDataPtr->viewStartX = 160;
282 camDataPtr->viewStartY = 0;
283 camDataPtr->nearClip = 8;
284 camDataPtr->farClip = 16384;
285 camDataPtr->vfov = 50;
286 initialize_next_camera(camDataPtr);
287
288 camDataPtr->flags = CAMERA_FLAG_DISABLED;
289 camDataPtr->updateMode = CAM_UPDATE_MINIMAL;
290 camDataPtr->viewWidth = 160;
291 camDataPtr->viewHeight = 120;
292 camDataPtr->viewStartX = 0;
293 camDataPtr->viewStartY = 120;
294 camDataPtr->nearClip = 8;
295 camDataPtr->farClip = 16384;
296 camDataPtr->vfov = 50;
297 initialize_next_camera(camDataPtr);
298
299 camDataPtr->flags = CAMERA_FLAG_DISABLED;
300 camDataPtr->updateMode = CAM_UPDATE_MINIMAL;
301 camDataPtr->viewWidth = 160;
302 camDataPtr->viewHeight = 120;
303 camDataPtr->viewStartX = 160;
304 camDataPtr->viewStartY = 120;
305 camDataPtr->nearClip = 8;
306 camDataPtr->farClip = 16384;
307 camDataPtr->vfov = 50;
308 initialize_next_camera(camDataPtr);
309}
f32 CamLengthScale
Definition cam_main.c:12
Camera * initialize_next_camera(CameraInitData *initData)
Definition cam_main.c:311

Referenced by load_demo_battle(), load_engine_data(), load_map_by_IDs(), state_init_logos(), state_init_title_screen(), state_step_demo(), state_step_intro(), state_step_startup(), and state_step_title_screen().

◆ initialize_next_camera()

Camera * initialize_next_camera ( CameraInitData * initData)

Definition at line 311 of file cam_main.c.

311 {
312 Camera* camera;
313 s32 camID;
314
315 for (camID = 0; camID < ARRAY_COUNT(gCameras); camID++) {
316 camera = &gCameras[camID];
317
318 if (camera->flags == 0) {
319 break;
320 }
321 }
322
323 ASSERT(camID < ARRAY_COUNT(gCameras));
324
326 camera->moveFlags = 0;
327 camera->lookAt_eye.x = 0;
328 camera->lookAt_eye.y = 0;
329 camera->lookAt_eye.z = 0;
330 camera->lookAt_obj.x = 0;
331 camera->lookAt_obj.y = 0;
332 camera->lookAt_obj.z = -100.0f;
333 camera->curYaw = 0.0f;
334 camera->curBoomLength = 0;
335 camera->targetOffsetY = 0;
336 camera->curBoomYaw = 0.0f;
337 camera->targetBoomYaw = 0.0f;
338 camera->needsInit = TRUE;
339 camera->updateMode = initData->updateMode;
340 camera->nearClip = initData->nearClip;
341 camera->farClip = initData->farClip;
342 camera->vfov = initData->vfov;
343 camera->params.world.zoomPercent = 100;
344 set_cam_viewport(camID, initData->viewStartX, initData->viewStartY, initData->viewWidth, initData->viewHeight);
345 camera->bgColor[0] = 0;
346 camera->bgColor[1] = 0;
347 camera->bgColor[2] = 0;
348 camera->lookAt_obj_target.x = 0;
349 camera->lookAt_obj_target.y = 0;
350 camera->lookAt_obj_target.z = 0;
351 camera->targetPos.x = 0;
352 camera->targetPos.y = 0;
353 camera->targetPos.z = 0;
354 camera->fpDoPreRender = NULL;
355 camera->fpDoPostRender = NULL;
356 camera->leadAmount = 0.0f;
357 camera->targetLeadAmount = 0.0f;
358 camera->leadInterpAlpha = 0.0f;
359 camera->accumulatedStickLead = 0.0f;
360 camera->increasingLeadInterp = FALSE;
361 camera->prevLeadPosX = 0.0f;
362 camera->prevLeadPosZ = 0.0f;
363 camera->leadConstrainDir = 0;
364 camera->needsInitialConstrainDir = TRUE;
365 camera->prevLeadSettings = NULL;
366 camera->panActive = FALSE;
367 camera->useOverrideSettings = FALSE;
368 camera->leadAmtScale = 0.2f;
369 camera->moveSpeed = 1.0f;
370 return camera;
371}
void set_cam_viewport(s16 id, s16 x, s16 y, s16 width, s16 height)
Definition cam_main.c:373
#define ASSERT(condition)
@ CAMERA_FLAG_INITIALIZED
Definition enums.h:4720
s16 bgColor[3]
f32 targetOffsetY
Vec3f lookAt_obj_target
s32 increasingLeadInterp
f32 leadInterpAlpha
f32 prevLeadPosX
b32 needsInitialConstrainDir
f32 targetBoomYaw
CameraControlSettings * prevLeadSettings
s32 leadConstrainDir
b16 useOverrideSettings
union Camera::@17 params
f32 targetLeadAmount
f32 curBoomLength
f32 accumulatedStickLead
f32 leadAmtScale
f32 prevLeadPosZ

Referenced by create_cameras().

◆ set_cam_viewport()

void set_cam_viewport ( s16 id,
s16 x,
s16 y,
s16 width,
s16 height )

Definition at line 373 of file cam_main.c.

373 {
374 Camera* camera = &gCameras[id];
375
376 camera->viewportW = width;
377 camera->viewportH = height;
378 camera->viewportStartX = x;
379 camera->viewportStartY = y;
380
381 camera->vp.vp.vscale[0] = 2.0f * camera->viewportW;
382 camera->vp.vp.vscale[1] = 2.0f * camera->viewportH;
383 camera->vp.vp.vscale[2] = 0x1FF;
384 camera->vp.vp.vscale[3] = 0;
385
386 camera->vp.vp.vtrans[0] = 4 * (s16) ((u16) camera->viewportStartX + (camera->viewportW / 2));
387 camera->vp.vp.vtrans[1] = (s16) ((u16) camera->viewportStartY + (camera->viewportH / 2));
388 camera->vp.vp.vtrans[1] = 4 * camera->vp.vp.vtrans[1];
389 camera->vp.vp.vtrans[2] = 0x1FF;
390 camera->vp.vp.vtrans[3] = 0;
391
392 camera->vpAlt.vp.vscale[0] = 2.0f * camera->viewportW;
393 camera->vpAlt.vp.vscale[1] = 2.0f * camera->viewportH;
394 camera->vpAlt.vp.vscale[2] = 0x1FF;
395 camera->vpAlt.vp.vscale[3] = 0;
396
397 camera->vpAlt.vp.vtrans[0] = gGameStatusPtr->altViewportOffset.x + 4 * (s16) ((u16) camera->viewportStartX + (camera->viewportW / 2));
398 camera->vpAlt.vp.vtrans[1] = gGameStatusPtr->altViewportOffset.y + 4 * (s16) ((u16) camera->viewportStartY + (camera->viewportH / 2));
399 camera->vpAlt.vp.vtrans[2] = 0x200;
400 camera->vpAlt.vp.vtrans[3] = 0;
401}

Referenced by hud_element_setup_cam(), initialize_next_camera(), load_map_by_IDs(), state_init_file_select(), state_init_logos(), state_init_title_screen(), and state_step_demo().

◆ get_cam_viewport()

void get_cam_viewport ( s32 camID,
u16 * x,
u16 * y,
u16 * width,
u16 * height )

Definition at line 403 of file cam_main.c.

403 {
404 *width = gCameras[camID].viewportW;
405 *height = gCameras[camID].viewportH;
406 *x = gCameras[camID].viewportStartX;
407 *y = gCameras[camID].viewportStartY;
408}

◆ get_screen_coords()

void get_screen_coords ( s32 camID,
f32 x,
f32 y,
f32 z,
s32 * screenX,
s32 * screenY,
s32 * screenZ )

Definition at line 410 of file cam_main.c.

410 {
411 Camera* camera = &gCameras[camID];
412 f32 tW;
413 f32 tZ;
414 f32 tY;
415 f32 tX;
416
417 transform_point(camera->mtxPerspective, x, y, z, 1.0f, &tX, &tY, &tZ, &tW);
418
419 *screenZ = tZ + 5000.0f;
420 if (*screenZ < 0) {
421 *screenZ = 0;
422 } else if (*screenZ > 10000) {
423 *screenZ = 10000;
424 }
425
426 if (tW < 0.01 && tW > -0.01) {
427 *screenX = 0;
428 *screenY = 0;
429 *screenZ = 0;
430 } else {
431 *screenX = camera->viewportStartX + (s32) ((1.0f + tX / tW) * camera->viewportW * 0.5f);
432 *screenY = camera->viewportStartY + (s32) ((1.0f - tY / tW) * camera->viewportH * 0.5f);
433 }
434}

Referenced by _show_message(), btl_draw_enemy_health_bars(), btl_state_draw_select_target(), draw_all_status_icons(), draw_encounters_pre_battle(), render_player_model(), sfx_compute_spatialized_sound_params_full(), sfx_compute_spatialized_sound_params_ignore_depth(), sfx_compute_spatialized_sound_params_with_depth(), update_cameras(), and update_encounters_neutral().

◆ is_outside_cam_viewport_bounds()

b32 is_outside_cam_viewport_bounds ( s32 camID,
s32 x,
s32 y )

Definition at line 436 of file cam_main.c.

436 {
437 s32 startX = gCameras[camID].viewportStartX;
438 s32 startY = gCameras[camID].viewportStartY;
439 s32 endX = startX + gCameras[camID].viewportW;
440 s32 endY = startY + gCameras[camID].viewportH;
441
442 if (x < startX) {
443 return TRUE;
444 } else if (x > endX) {
445 return TRUE;
446 } else if (y < startY) {
447 return TRUE;
448 } else if (y > endY) {
449 return TRUE;
450 } else {
451 return FALSE;
452 }
453}

◆ get_cam_viewport_bounds()

void get_cam_viewport_bounds ( s32 camID,
s32 * x,
s32 * y,
s32 * width,
s32 * height )

Definition at line 455 of file cam_main.c.

455 {
456 *x = gCameras[camID].viewportStartX;
457 *y = gCameras[camID].viewportStartY;
458 *width = gCameras[camID].viewportStartX + gCameras[camID].viewportW;
459 *height = gCameras[camID].viewportStartY + gCameras[camID].viewportH;
460}

Variable Documentation

◆ CamLengthScale

f32 CamLengthScale

◆ gCurrentCamID

◆ nuGfxCfb_ptr

◆ gMainGfxPos

Gfx* gMainGfxPos

Definition at line 15 of file cam_main.c.

Referenced by _render_transition_stencil(), appendGfx_animator(), appendGfx_animator_node(), appendGfx_background_texture(), appendGfx_darkness_stencil(), appendGfx_draw_prev_frame_buffer(), appendGfx_entity_model(), appendGfx_interact_prompt(), appendGfx_intro_logos(), appendGfx_ispy_icon(), appendGfx_item_entity(), appendGfx_message(), appendGfx_model(), appendGfx_msg_prim_rect(), appendGfx_piranha_vines(), appendGfx_pulse_stone_icon(), appendGfx_reset_tile_pattern(), appendGfx_screen_transition_stencil(), appendGfx_shading_palette(), appendGfx_speech_bubble(), appendGfx_startup_prim_rect(), appendGfx_title_screen(), aura_appendGfx(), balloon_appendGfx(), big_smoke_puff_appendGfx(), big_snowflakes_appendGfx(), blast_appendGfx(), bombette_breaking_appendGfx(), breaking_junk_appendGfx(), btl_appendGfx_prim_quad(), btl_bonk_setup_gfx(), btl_menu_moves_draw_content(), btl_menu_strats_draw_content(), build_custom_gfx(), build_gfx_blue_stars(), build_gfx_green_stars(), build_gfx_pink_stars(), build_gfx_star(), build_gfx_yellow_stars(), bulb_glow_appendGfx(), butterflies_appendGfx(), chapter_change_appendGfx(), chomp_drop_appendGfx(), cloud_puff_appendGfx(), cloud_trail_appendGfx(), cold_breath_appendGfx(), confetti_appendGfx(), damage_indicator_render_impl(), damage_stars_appendGfx(), debuff_appendGfx(), draw_adjustable_tiled_image(), draw_all_status_icons(), draw_box(), draw_ci_image_with_clipping(), draw_coin_sparkles(), draw_digit(), draw_entity_model_E(), draw_hud_element_internal(), draw_image_with_clipping(), draw_number(), draw_tiled_image(), drop_leaves_appendGfx(), dust_appendGfx(), effect_3D_appendGfx(), effect_46_appendGfx(), effect_63_appendGfx(), effect_65_appendGfx(), effect_75_appendGfx(), effect_86_appendGfx(), embers_appendGfx(), emote_appendGfx(), ending_decals_appendGfx(), energy_in_out_appendGfx(), energy_orb_wave_appendGfx(), energy_shockwave_appendGfx(), entity_ArrowSign_setupGfx(), entity_base_block_setupGfx(), entity_BlueWarpPipe_setupGfx(), Entity_BoardedFloor_setupGfx(), entity_BombableRock_setupGfx(), entity_Chest_setupGfx(), entity_HeartBlockContent__setupGfx(), entity_HiddenPanel_setupGfx(), entity_ItemBlock_setupGfx(), entity_model_set_shadow_color(), entity_Padlock_setupGfx(), entity_PinkFlowerLight_setupGfx(), entity_SaveBlock_setupGfx(), entity_shattering_setupGfx(), entity_SpinningFlower_setupGfx(), entity_StarBoxLauncher_setupGfx(), entity_SuperBlockContent_setupGfx(), entity_Tweester_render_face(), entity_Tweester_render_inner_whirl(), entity_Tweester_render_outer_whirl(), entity_Tweester_setupGfx(), entity_WoodenCrate_setupGfx(), execute_render_tasks(), explosion_appendGfx(), falling_leaves_appendGfx(), filemenu_draw_char(), filemenu_draw_contents_choose_name(), filemenu_draw_contents_copy_arrow(), filemenu_draw_rect(), filemenu_update_hidden_name_confirm(), filemenu_update_show_name_confirm(), fire_breath_appendGfx(), fire_flower_appendGfx(), firework_rocket_appendGfx(), flame_appendGfx(), flashing_box_shockwave_appendGfx(), floating_cloud_puff_appendGfx(), floating_flower_appendGfx(), floating_rock_appendGfx(), flower_splash_appendGfx(), flower_trail_appendGfx(), footprint_appendGfx(), fright_jar_appendGfx(), func_80027BAC(), func_800F102C(), func_8010FD98(), func_80143C48(), func_801491E4(), func_E005E334(), func_E006A85C(), func_E0080448(), func_E0082580(), func_E00826C4(), func_E00828B4(), func_E0082A84(), func_E00863B4(), func_E0090444(), func_E00AC2A4(), func_E00D8334(), func_E00D8630(), func_E010E000(), func_E0112330(), func_E01166E8(), func_E011A3BC(), func_E011A48C(), func_E011A700(), func_E02000AC(), gather_energy_pink_appendGfx(), gather_magic_appendGfx(), gfx_build_knocked_down_player(), gfx_draw_background(), gfx_draw_frame(), gfx_init_state(), gfx_task_background(), got_item_outline_appendGfx(), green_impact_appendGfx(), hieroglyphs_appendGfx(), hud_element_draw_rect(), huff_puff_breath_appendGfx(), ice_pillar_appendGfx(), ice_shard_appendGfx(), imgfx_appendGfx_mesh(), imgfx_appendGfx_mesh_anim(), imgfx_appendGfx_mesh_basic(), imgfx_appendGfx_mesh_grid(), imgfx_appendGfx_mesh_strip(), is_model_center_visible(), is_point_visible(), landing_dust_appendGfx(), lens_flare_appendGfx(), light_rays_appendGfx(), lightning_appendGfx(), lightning_bolt_appendGfx(), lil_oink_appendGfx(), mdl_draw_hidden_panel_surface(), merlin_house_stars_appendGfx(), misc_particles_appendGfx(), motion_blur_flame_appendGfx(), moving_cloud_appendGfx(), msg_draw_char(), msg_draw_choice_pointer(), msg_draw_frame(), msg_draw_speech_arrow(), msg_draw_speech_bubble(), msg_reset_gfx_state(), msg_update_rewind_arrow(), music_note_appendGfx(), pause_badges_draw_contents(), pause_draw_menu_label(), pause_draw_rect(), pause_items_draw_contents(), pause_map_draw_contents(), pause_partners_draw_contents(), pause_spirits_draw_contents(), pause_textbox_draw_contents(), pause_tutorial_draw_contents(), peach_star_beam_appendGfx(), pink_sparkles_appendGfx(), popup_menu_draw_menu_contents(), purple_ring_appendGfx(), quizmo_answer_main(), quizmo_assistant_appendGfx(), quizmo_audience_appendGfx(), quizmo_stage_appendGfx(), radial_shimmer_appendGfx(), radiating_energy_orb_appendGfx(), red_impact_appendGfx(), render_curtains(), render_effects_UI(), render_frame(), render_hud_element(), render_hud_elements_backUI(), render_hud_elements_frontUI(), render_item_entities(), render_messages(), render_transform_group(), render_transform_group_node(), render_transformed_hud_elements(), render_window_root(), ring_blast_appendGfx(), rising_bubble_appendGfx(), shape_spell_appendGfx(), shattering_stones_appendGfx(), shimmer_burst_appendGfx(), shimmer_wave_appendGfx(), shiny_flare_appendGfx(), shockwave_appendGfx(), sleep_bubble_appendGfx(), small_gold_sparkle_appendGfx(), smoke_burst_appendGfx(), smoke_impact_appendGfx(), smoke_ring_appendGfx(), snaking_static_appendGfx(), snowfall_appendGfx(), snowflake_appendGfx(), snowman_doll_appendGfx(), something_rotating_appendGfx(), sparkles_appendGfx(), spiky_white_aura_appendGfx(), spirit_card_appendGfx(), spr_appendGfx_component(), spr_appendGfx_component_flat(), squirt_appendGfx(), star_appendGfx(), star_outline_appendGfx(), star_spirits_energy_appendGfx(), stars_burst_appendGfx(), stars_shimmer_appendGfx(), stars_spread_appendGfx(), static_status_appendGfx(), steam_burst_appendGfx(), stop_watch_appendGfx(), sun_appendGfx(), sweat_appendGfx(), tattle_cam_pre_render(), tattle_window_fill_clipped_quad(), throw_spiny_appendGfx(), thunderbolt_ring_appendGfx(), title_screen_draw_copyright(), title_screen_draw_logo(), title_screen_draw_press_start(), tubba_heart_attack_appendGfx(), underwater_appendGfx(), unkAngleFunc002(), unkAngleFunc003(), update_status_bar(), virtual_entity_appendGfx_quad(), walking_dust_appendGfx(), water_block_appendGfx(), water_fountain_appendGfx(), water_splash_appendGfx(), waterfall_appendGfx(), whirlwind_appendGfx(), and windy_leaves_appendGfx().

◆ gDisplayContext

DisplayContext* gDisplayContext

Definition at line 16 of file cam_main.c.

Referenced by _render_transition_stencil(), appendGfx_animator(), appendGfx_animator_node(), appendGfx_darkness_stencil(), appendGfx_entity_model(), appendGfx_interact_prompt(), appendGfx_ispy_icon(), appendGfx_item_entity(), appendGfx_pulse_stone_icon(), appendGfx_reset_tile_pattern(), appendGfx_speech_bubble(), aura_appendGfx(), balloon_appendGfx(), big_smoke_puff_appendGfx(), big_snowflakes_appendGfx(), blast_appendGfx(), bombette_breaking_appendGfx(), breaking_junk_appendGfx(), butterflies_appendGfx(), chomp_drop_appendGfx(), cloud_puff_appendGfx(), cloud_trail_appendGfx(), cold_breath_appendGfx(), confetti_appendGfx(), damage_indicator_render_impl(), damage_stars_appendGfx(), debuff_appendGfx(), draw_box(), draw_coin_sparkles(), draw_entity_model_E(), drop_leaves_appendGfx(), dust_appendGfx(), effect_3D_appendGfx(), effect_46_appendGfx(), effect_63_appendGfx(), effect_65_appendGfx(), effect_75_appendGfx(), effect_86_appendGfx(), embers_appendGfx(), emote_appendGfx(), ending_decals_appendGfx(), energy_in_out_appendGfx(), energy_orb_wave_appendGfx(), energy_shockwave_appendGfx(), entity_ArrowSign_setupGfx(), entity_BlueWarpPipe_setupGfx(), Entity_BoardedFloor_setupGfx(), entity_BombableRock_setupGfx(), entity_Chest_setupGfx(), entity_HeartBlockContent__setupGfx(), entity_HiddenPanel_setupGfx(), entity_Padlock_setupGfx(), entity_PinkFlowerLight_setupGfx(), entity_SaveBlock_setupGfx(), entity_shattering_setupGfx(), entity_SpinningFlower_setupGfx(), entity_StarBoxLauncher_setupGfx(), entity_SuperBlockContent_setupGfx(), entity_Tweester_render_inner_whirl(), entity_Tweester_render_outer_whirl(), entity_WoodenCrate_setupGfx(), execute_render_tasks(), explosion_appendGfx(), falling_leaves_appendGfx(), filemenu_draw_contents_copy_arrow(), fire_breath_appendGfx(), fire_flower_appendGfx(), flame_appendGfx(), flashing_box_shockwave_appendGfx(), floating_cloud_puff_appendGfx(), floating_flower_appendGfx(), floating_rock_appendGfx(), flower_splash_appendGfx(), flower_trail_appendGfx(), footprint_appendGfx(), fright_jar_appendGfx(), func_800F102C(), func_80143C48(), func_E005E334(), func_E0080448(), func_E0082580(), func_E00826C4(), func_E00863B4(), func_E0090444(), func_E00AC2A4(), func_E0112330(), func_E01166E8(), gather_energy_pink_appendGfx(), gather_magic_appendGfx(), gfx_build_knocked_down_player(), gfx_draw_frame(), gfx_task_background(), got_item_outline_appendGfx(), green_impact_appendGfx(), hieroglyphs_appendGfx(), huff_puff_breath_appendGfx(), ice_pillar_appendGfx(), ice_shard_appendGfx(), imgfx_appendGfx_mesh_anim(), imgfx_appendGfx_mesh_strip(), landing_dust_appendGfx(), lens_flare_appendGfx(), light_rays_appendGfx(), lightning_appendGfx(), lightning_bolt_appendGfx(), lil_oink_appendGfx(), mdl_update_transform_matrices(), merlin_house_stars_appendGfx(), misc_particles_appendGfx(), moving_cloud_appendGfx(), msg_draw_speech_arrow(), msg_draw_speech_bubble(), msg_update_rewind_arrow(), music_note_appendGfx(), pause_partners_draw_contents(), pause_spirits_draw_contents(), pause_tutorial_draw_contents(), peach_star_beam_appendGfx(), pink_sparkles_appendGfx(), purple_ring_appendGfx(), quizmo_assistant_appendGfx(), quizmo_audience_appendGfx(), quizmo_stage_appendGfx(), radial_shimmer_appendGfx(), radiating_energy_orb_appendGfx(), red_impact_appendGfx(), render_effects_UI(), render_frame(), render_hud_element(), render_item_entities(), ring_blast_appendGfx(), rising_bubble_appendGfx(), shape_spell_appendGfx(), shattering_stones_appendGfx(), shimmer_burst_appendGfx(), shimmer_wave_appendGfx(), shiny_flare_appendGfx(), shockwave_appendGfx(), sleep_bubble_appendGfx(), small_gold_sparkle_appendGfx(), smoke_burst_appendGfx(), smoke_impact_appendGfx(), smoke_ring_appendGfx(), snaking_static_appendGfx(), snowfall_appendGfx(), snowflake_appendGfx(), snowman_doll_appendGfx(), sparkles_appendGfx(), spiky_white_aura_appendGfx(), spr_appendGfx_component(), squirt_appendGfx(), star_appendGfx(), star_outline_appendGfx(), star_spirits_energy_appendGfx(), stars_burst_appendGfx(), stars_shimmer_appendGfx(), stars_spread_appendGfx(), static_status_appendGfx(), steam_burst_appendGfx(), stop_watch_appendGfx(), sun_appendGfx(), sweat_appendGfx(), tattle_cam_pre_render(), throw_spiny_appendGfx(), thunderbolt_ring_appendGfx(), tubba_heart_attack_appendGfx(), underwater_appendGfx(), update_cameras(), walking_dust_appendGfx(), water_block_appendGfx(), water_fountain_appendGfx(), water_splash_appendGfx(), waterfall_appendGfx(), whirlwind_appendGfx(), and windy_leaves_appendGfx().

◆ gCameras

Camera gCameras[4]

Definition at line 17 of file cam_main.c.

Referenced by _render_transition_stencil(), action_hammer_end_swing(), action_hammer_test_swing_collision(), action_update_falling(), action_update_hit_fire(), action_update_hit_lava(), action_update_jump(), action_update_knockback(), action_update_land(), action_update_landing_on_switch(), action_update_parasol(), action_update_peach_falling(), action_update_peach_step_down(), action_update_sliding(), action_update_spin(), action_update_spin_jump(), action_update_step_down(), action_update_tornado_jump(), action_update_use_munchlesia(), action_update_use_spinning_flower(), appendGfx_background_texture(), appendGfx_darkness_stencil(), appendGfx_interact_prompt(), appendGfx_ispy_icon(), appendGfx_item_entity(), appendGfx_model(), appendGfx_player(), appendGfx_player_spin(), appendGfx_pulse_stone_icon(), appendGfx_screen_transition_stencil(), appendGfx_shading_palette(), appendGfx_speech_bubble(), aura_appendGfx(), balloon_appendGfx(), big_smoke_puff_appendGfx(), big_snowflakes_appendGfx(), blast_appendGfx(), bombette_breaking_appendGfx(), breaking_junk_appendGfx(), btl_bonk_update(), btl_cam_set_params(), btl_cam_set_pos(), btl_restore_world_cameras(), btl_save_world_cameras(), btl_state_draw_end_battle(), btl_state_update_normal_start(), calculate_camera_yinterp_rate(), can_dismount(), check_conversation_trigger(), CleftAI_CanSeePlayer(), cloud_puff_appendGfx(), cloud_trail_appendGfx(), cold_breath_appendGfx(), collision_main_above(), collision_main_lateral(), confetti_appendGfx(), create_cameras(), create_shading_palette(), damage_indicator_render_impl(), damage_stars_appendGfx(), damage_stars_main(), debuff_appendGfx(), draw_all_status_icons(), draw_coin_sparkles(), draw_entity_model_A(), draw_entity_model_B(), draw_shop_items(), drop_leaves_appendGfx(), dust_appendGfx(), effect_3D_appendGfx(), effect_46_appendGfx(), effect_63_appendGfx(), effect_75_appendGfx(), effect_75_render(), effect_86_appendGfx(), embers_appendGfx(), emote_appendGfx(), ending_decals_appendGfx(), energy_in_out_appendGfx(), energy_orb_wave_appendGfx(), entity_BlueWarpPipe_enter_pipe_init(), entity_GiantChest_open(), entity_HiddenPanel_flip_over(), entity_PinkFlowerLight_idle(), entity_PinkFlowerLight_setupGfx(), entity_Tweester_idle(), explosion_appendGfx(), falling_leaves_appendGfx(), fire_breath_appendGfx(), fire_flower_appendGfx(), firework_rocket_appendGfx(), flame_appendGfx(), flame_render(), flashing_box_shockwave_appendGfx(), floating_cloud_puff_appendGfx(), fright_jar_appendGfx(), func_800E4AD8(), func_800E4B40(), func_80143C48(), func_802BB98C_E2E2BC(), func_802BC17C_E2EAAC(), func_E0020000(), func_E005E334(), func_E0080448(), func_E0082580(), func_E00863B4(), func_E008A000(), func_E008A290(), func_E0090444(), func_E00AC2A4(), func_E0112330(), func_E01166E8(), func_E011A700(), game_input_to_move_vector(), gather_energy_pink_appendGfx(), gather_energy_pink_update(), gather_magic_appendGfx(), get_cam_viewport(), get_cam_viewport_bounds(), get_movement_from_input(), get_screen_coords(), gfx_draw_background(), got_item_outline_appendGfx(), green_impact_appendGfx(), hieroglyphs_appendGfx(), hud_element_setup_cam(), huff_puff_breath_appendGfx(), ice_pillar_appendGfx(), ice_shard_appendGfx(), imgfx_appendGfx_mesh(), imgfx_appendGfx_mesh_basic(), initialize_battle(), initialize_next_camera(), interact_inspect_setup(), interact_speech_setup(), is_model_center_visible(), is_outside_cam_viewport_bounds(), is_point_visible(), landing_dust_appendGfx(), lens_flare_appendGfx(), lightning_appendGfx(), load_map_by_IDs(), MagikoopaAI_CanShootSpell(), MeleeHitbox_CanSeePlayer(), misc_particles_appendGfx(), misc_particles_update(), moving_cloud_appendGfx(), music_note_appendGfx(), npc_get_render_yaw(), offset_player_from_camera(), partner_do_player_collision(), partner_flying_follow_player(), partner_force_player_flip_done(), partner_get_out(), partner_walking_follow_player(), peach_disguise_check_overlaps(), peach_star_beam_appendGfx(), phys_adjust_cam_on_landing(), phys_check_interactable_collision(), phys_update_action_state(), phys_update_lava_reset(), phys_update_standard(), pink_sparkles_appendGfx(), PiranhaPlantAI_10(), player_get_camera_facing_angle(), player_get_side_angle(), player_input_to_move_vector(), player_raycast_below_cam_relative(), player_update_sprite(), ProjectileHitbox_GetUsableProjectileID(), quizmo_assistant_appendGfx(), quizmo_audience_appendGfx(), Quizmo_NPC_OnRender(), quizmo_stage_appendGfx(), radial_shimmer_appendGfx(), radial_shimmer_update(), radiating_energy_orb_appendGfx(), red_impact_appendGfx(), render_effects_UI(), render_frame(), render_item_entities(), render_models(), render_npcs(), reset_player_status(), ring_blast_appendGfx(), rising_bubble_appendGfx(), set_cam_viewport(), set_npc_yaw(), set_screen_overlay_center_worldpos(), sfx_compute_spatialized_sound_params_with_depth(), shape_spell_appendGfx(), shattering_stones_appendGfx(), shiny_flare_appendGfx(), shockwave_appendGfx(), show_immune_bonk(), sleep_bubble_appendGfx(), small_gold_sparkle_appendGfx(), smoke_burst_appendGfx(), smoke_impact_appendGfx(), smoke_ring_appendGfx(), snaking_static_appendGfx(), snowfall_appendGfx(), snowfall_update(), snowflake_appendGfx(), sparkles_appendGfx(), spawn_drops(), spiky_white_aura_appendGfx(), spiky_white_aura_main(), spr_appendGfx_component_flat(), spr_draw_npc_sprite(), spr_draw_player_sprite(), star_appendGfx(), star_main(), star_outline_appendGfx(), star_spirits_energy_appendGfx(), stars_burst_appendGfx(), stars_shimmer_appendGfx(), stars_spread_appendGfx(), state_init_file_select(), state_init_logos(), state_init_title_screen(), state_step_intro(), static_status_appendGfx(), steam_burst_appendGfx(), stop_watch_appendGfx(), sweat_appendGfx(), sweat_main(), sync_held_position(), sync_player_position(), tattle_cam_pre_render(), test_item_player_collision(), throw_spiny_appendGfx(), thunderbolt_ring_appendGfx(), tubba_heart_attack_appendGfx(), update_cameras(), update_encounters_neutral(), update_entities(), update_item_entity_collectable(), update_nonplayer_actor_shadow(), update_player_actor_shadow(), update_player_shadow(), update_riding_physics(), update_riding_physics(), update_shadows(), walking_dust_appendGfx(), water_fountain_appendGfx(), water_splash_appendGfx(), waterfall_appendGfx(), and windy_leaves_appendGfx().