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

Go to the source code of this file.

Functions

s32 step_entity_model_commandlist (EntityModel *entityModel)
 
void free_entity_model_by_ref (EntityModel *entityModel)
 
void clear_entity_models (void)
 
void init_entity_models (void)
 
s32 load_entity_model (EntityModelScript *cmdList)
 
s32 ALT_load_entity_model (EntityModelScript *cmdList)
 
void exec_entity_model_commandlist (s32 idx)
 
void make_entity_model_mtx_flipZ (Matrix4f mtx)
 
void appendGfx_entity_model (EntityModel *model)
 
void draw_entity_model_A (s32 modelIdx, Mtx *transformMtx)
 
void draw_entity_model_B (s32 modelIdx, Mtx *transformMtx, s32 vertexSegment, Vec3s *vertexArray)
 
void draw_entity_model_C (s32 modelIdx, Mtx *transformMtx)
 
void draw_entity_model_D (s32 modelIdx, Mtx *transformMtx, s32 arg2, Vec3s *vertexArray)
 
void draw_entity_model_E (s32 modelIdx, Mtx *transformMtx)
 
void set_entity_model_render_command_list (s32 idx, EntityModelScript *cmdList)
 
EntityModelget_entity_model (s32 listIndex)
 
void free_entity_model_by_index (s32 idx)
 
void set_entity_model_flags (s32 idx, s32 newFlags)
 
void clear_entity_model_flags (s32 idx, s32 newFlags)
 
void bind_entity_model_setupGfx (s32 idx, void *setupGfxCallbackArg0, void(*fpSetupGfxCallback)(void *))
 
void func_80122F8C (s32 idx, s32 newFlags)
 
void func_80122FB8 (s32 idx, s32 newFlags)
 
void enable_entity_fog (void)
 
void disable_entity_fog (void)
 
void set_entity_fog_dist (s32 min, s32 max)
 
void set_entity_fog_color (s32 r, s32 g, s32 b, s32 a)
 
s32 is_entity_fog_enabled (void)
 
void get_entity_fog_distance (s32 *start, s32 *end)
 
void get_entity_fog_color (s32 *r, s32 *g, s32 *b, s32 *a)
 

Variables

EntityModelScript D_8014C260
 
Lights1 D_8014C268 = gdSPDefLights1(255, 255, 255, 0, 0, 0, 0, 0, 0)
 
s32 gEntityModelCount
 
BSS EntityModelList gWorldEntityModelList
 
BSS EntityModelList gBattleEntityModelList
 
BSS EntityModelListgCurrentEntityModelList
 
BSS s32 D_80154374
 
BSS s32 entity_fog_enabled
 
BSS s32 entity_fog_red
 
BSS s32 entity_fog_green
 
BSS s32 entity_fog_blue
 
BSS s32 entity_fog_alpha
 
BSS s32 entity_fog_dist_min
 
BSS s32 entity_fog_dist_max
 
Gfx Gfx_RM1_SURFACE_OPA []
 
Gfx Gfx_RM1_DECAL_OPA []
 
Gfx Gfx_RM1_INTERSECTING_OPA []
 
Gfx Gfx_RM1_ALPHATEST []
 
Gfx Gfx_RM1_SURFACE_XLU []
 
Gfx Gfx_RM1_DECAL_XLU []
 
Gfx Gfx_RM1_INTERSECTING_XLU []
 
Gfx Gfx_RM1_ALPHATEST_ONESIDED []
 
Gfx Gfx_RM1_SURFACE_XLU_NO_AA []
 
Gfx Gfx_RM1_DECAL_XLU_NO_AA []
 
Gfx Gfx_RM1_PASS_THROUGH []
 
Gfx Gfx_RM1_SURFACE_OPA_NO_ZB []
 
Gfx Gfx_RM1_ALPHATEST_NO_ZB []
 
Gfx Gfx_RM1_SURFACE_XLU_NO_ZB []
 
Gfx Gfx_RM1_CLOUD_NO_ZCMP []
 
Gfx Gfx_RM3_SURFACE_OPA []
 
Gfx Gfx_RM3_DECAL_OPA []
 
Gfx Gfx_RM3_INTERSECTING_OPA []
 
Gfx Gfx_RM3_ALPHATEST []
 
Gfx Gfx_RM3_SURFACE_XLU []
 
Gfx Gfx_RM3_DECAL_XLU []
 
Gfx Gfx_RM3_INTERSECTING_XLU []
 

Function Documentation

◆ step_entity_model_commandlist()

s32 step_entity_model_commandlist ( EntityModel * entityModel)

Definition at line 192 of file entity_model.c.

192 {
193 SpriteRasterInfo* imageData;
194
195 u32* curPos = *entityModel->cmdListReadPos;
196 switch (*curPos++) {
197 case ENTITY_MODEL_SCRIPT_OP_End: // kill model
198 free_entity_model_by_ref(entityModel);
199 return 1;
200 case ENTITY_MODEL_SCRIPT_OP_Draw: // set display list ptr
201 entityModel->nextFrameTime = (f32) *curPos++;
202 entityModel->gfx.displayList = (Gfx*) *curPos++;
203 entityModel->cmdListReadPos = (EntityModelScript*) curPos;
204 break;
205 case ENTITY_MODEL_SCRIPT_OP_Restart: // restore saved position
206 entityModel->cmdListReadPos = entityModel->cmdListSavedPos;
207 return 1;
208 case ENTITY_MODEL_SCRIPT_OP_Loop: // set saved position
209 entityModel->cmdListReadPos = entityModel->cmdListSavedPos = (EntityModelScript*) curPos;
210 return 1;
211 case ENTITY_MODEL_SCRIPT_OP_SetRenderMode: // set render mode
212 entityModel->renderMode = *curPos++;
213 entityModel->cmdListReadPos = (EntityModelScript*) curPos;
214 return 1;
215 case ENTITY_MODEL_SCRIPT_OP_SetFlags: // set flags
216 entityModel->flags |= *curPos++;
217 entityModel->cmdListReadPos = (EntityModelScript*) curPos;
218 return 1;
219 case ENTITY_MODEL_SCRIPT_OP_ClearFlags: // clear flags
220 entityModel->flags &= ~*curPos++;
221 entityModel->cmdListReadPos = (EntityModelScript*) curPos;
222 return 1;
223 case ENTITY_MODEL_SCRIPT_OP_DrawImage: // set image data
224 imageData = entityModel->gfx.imageData;
225 entityModel->nextFrameTime = *curPos++;
226 imageData->raster = (u8*)*curPos++;
227 imageData->defaultPal = (PAL_PTR) *curPos++;
228 imageData->width = *curPos++;
229 imageData->height = *curPos++;
230 entityModel->cmdListReadPos = (EntityModelScript*) curPos;
231 break;
232 }
233 return 0;
234}
#define PAL_PTR
s32 EntityModelScript[]
Definition entity.h:7
@ ENTITY_MODEL_SCRIPT_OP_SetFlags
Definition entity.h:30
@ ENTITY_MODEL_SCRIPT_OP_Draw
Definition entity.h:26
@ ENTITY_MODEL_SCRIPT_OP_Loop
Definition entity.h:28
@ ENTITY_MODEL_SCRIPT_OP_SetRenderMode
Definition entity.h:29
@ ENTITY_MODEL_SCRIPT_OP_Restart
Definition entity.h:27
@ ENTITY_MODEL_SCRIPT_OP_End
Definition entity.h:25
@ ENTITY_MODEL_SCRIPT_OP_DrawImage
Definition entity.h:32
@ ENTITY_MODEL_SCRIPT_OP_ClearFlags
Definition entity.h:31
void free_entity_model_by_ref(EntityModel *entityModel)
s32 flags
Definition entity.h:448
EntityModelScript * cmdListSavedPos
Definition entity.h:461
union EntityModel::@46 gfx
EntityModelScript * cmdListReadPos
Definition entity.h:455
f32 nextFrameTime
Set to 1.0 after each update.
Definition entity.h:453
s8 renderMode
Definition entity.h:449

Referenced by exec_entity_model_commandlist().

◆ free_entity_model_by_ref()

void free_entity_model_by_ref ( EntityModel * entityModel)

Definition at line 745 of file entity_model.c.

745 {
746 s32 i;
747
748 for (i = 0; i < MAX_ENTITY_MODELS; i++) {
749 if ((*gCurrentEntityModelList)[i] == entityModel) {
750 break;
751 }
752 }
753
754 if (i < MAX_ENTITY_MODELS) {
756 }
757}
BSS EntityModelList * gCurrentEntityModelList
void free_entity_model_by_index(s32 idx)
#define MAX_ENTITY_MODELS
Definition macros.h:87

Referenced by step_entity_model_commandlist().

◆ clear_entity_models()

void clear_entity_models ( void )

Definition at line 51 of file entity_model.c.

51 {
52 s32 i;
53
56 } else {
58 }
59
60 for (i = 0; i < MAX_ENTITY_MODELS; i++) {
61 (*gCurrentEntityModelList)[i] = NULL;
62 }
63
66 entity_fog_red = 10;
68 entity_fog_blue = 10;
72}
BSS s32 entity_fog_blue
BSS EntityModelList gBattleEntityModelList
BSS s32 entity_fog_red
BSS s32 entity_fog_dist_max
s32 gEntityModelCount
BSS s32 entity_fog_green
BSS s32 entity_fog_dist_min
BSS s32 entity_fog_enabled
BSS s32 entity_fog_alpha
BSS EntityModelList gWorldEntityModelList
@ CONTEXT_WORLD
Definition enums.h:3529
GameStatus * gGameStatusPtr
Definition main_loop.c:32

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

◆ init_entity_models()

void init_entity_models ( void )

Definition at line 74 of file entity_model.c.

Referenced by state_step_end_battle(), and state_step_unpause().

◆ load_entity_model()

s32 load_entity_model ( EntityModelScript * cmdList)

Definition at line 93 of file entity_model.c.

93 {
94 EntityModel* newEntityModel;
95 s32* entityModelCount;
96 s32 i;
97
98 for (i = 0; i < MAX_ENTITY_MODELS; i++) {
99 if ((*gCurrentEntityModelList)[i] == NULL) {
100 break;
101 }
102 }
104
105 (*gCurrentEntityModelList)[i] = newEntityModel = heap_malloc(sizeof(*newEntityModel));
106 entityModelCount = &gEntityModelCount;
107 (*entityModelCount)++;
108
109 ASSERT(newEntityModel != NULL);
110
112 newEntityModel->renderMode = 1;
113 newEntityModel->gfx.displayList = NULL;
114 newEntityModel->cmdListReadPos = cmdList;
115 newEntityModel->nextFrameTime = 1.0f;
116 newEntityModel->timeScale = 1.0f;
117 if (cmdList == NULL) {
118 newEntityModel->cmdListReadPos = &D_8014C260;
119 }
120 newEntityModel->vertexArray = NULL;
121 newEntityModel->fpSetupGfxCallback = NULL;
122 newEntityModel->cmdListSavedPos = newEntityModel->cmdListReadPos;
123
126 }
127 return i;
128}
#define ASSERT(condition)
EntityModelScript D_8014C260
Definition entity_model.c:4
@ ENTITY_MODEL_FLAG_CAM1
Definition enums.h:5011
@ ENTITY_MODEL_FLAG_CAM2
Definition enums.h:5012
@ ENTITY_MODEL_FLAG_CAM0
Definition enums.h:5010
@ ENTITY_MODEL_FLAG_ENABLED
Definition enums.h:5014
void * heap_malloc(s32 size)
Definition heap.c:34
#define BATTLE_ENTITY_ID_BIT
Definition macros.h:146
void(* fpSetupGfxCallback)(void *)
Definition entity.h:463
Vec3s * vertexArray
Definition entity.h:462
f32 timeScale
Default is 1.0.
Definition entity.h:454

Referenced by create_entity(), create_shadow_from_data(), show_immune_bonk(), virtual_entity_create(), and virtual_entity_create_at_index().

◆ ALT_load_entity_model()

s32 ALT_load_entity_model ( EntityModelScript * cmdList)

Definition at line 130 of file entity_model.c.

130 {
131 EntityModel* newEntityModel;
132 SpriteRasterInfo* imageData;
133 s32 i;
134
135 for (i = 0; i < MAX_ENTITY_MODELS; i++) {
136 if ((*gCurrentEntityModelList)[i] == NULL) {
137 break;
138 }
139 }
141
142 {
143 s32* entityModelCount;
144 (*gCurrentEntityModelList)[i] = newEntityModel = heap_malloc(sizeof(*newEntityModel));
145 entityModelCount = &gEntityModelCount;
146 (*entityModelCount)++;
147 }
148
149 ASSERT(newEntityModel != NULL);
150
151 newEntityModel->gfx.imageData = imageData = heap_malloc(sizeof(*imageData));
152 ASSERT(imageData != NULL);
153
155 newEntityModel->renderMode = 1;
156 newEntityModel->cmdListReadPos = cmdList;
157 newEntityModel->nextFrameTime = 1.0f;
158 newEntityModel->timeScale = 1.0f;
159 if (cmdList == NULL) {
160 newEntityModel->cmdListReadPos = &D_8014C260;
161 }
162 newEntityModel->vertexArray = NULL;
163 newEntityModel->fpSetupGfxCallback = NULL;
164 newEntityModel->cmdListSavedPos = newEntityModel->cmdListReadPos;
165
168 }
169 return i;
170}
@ ENTITY_MODEL_FLAG_USE_IMAGE
Definition enums.h:5020

Referenced by ALT_virtual_entity_create().

◆ exec_entity_model_commandlist()

void exec_entity_model_commandlist ( s32 idx)

Definition at line 172 of file entity_model.c.

172 {
173 EntityModel* entityModel;
174
176 idx &= ~BATTLE_ENTITY_ID_BIT;
177 entityModel = (*gCurrentEntityModelList)[idx];
178 if (entityModel != NULL && (entityModel->flags)) {
179 if (!(entityModel->flags & ENTITY_MODEL_FLAG_HIDDEN)) {
180 if (!(entityModel->flags & ENTITY_MODEL_FLAG_DISABLE_SCRIPT)) {
181 entityModel->flags &= ~ENTITY_MODEL_FLAG_100;
182 entityModel->nextFrameTime -= entityModel->timeScale;
183 if (entityModel->nextFrameTime <= 0.0f) {
184 while (step_entity_model_commandlist(entityModel));
185 }
186 }
187 }
188 }
189 }
190}
s32 step_entity_model_commandlist(EntityModel *entityModel)
@ ENTITY_MODEL_FLAG_DISABLE_SCRIPT
Definition enums.h:5027
@ ENTITY_MODEL_FLAG_HIDDEN
Definition enums.h:5015

Referenced by ALT_virtual_entity_create(), btl_bonk_update(), create_entity(), update_entities(), update_shadows(), virtual_entity_create(), virtual_entity_create_at_index(), and virtual_entity_list_update().

◆ make_entity_model_mtx_flipZ()

void make_entity_model_mtx_flipZ ( Matrix4f mtx)

Definition at line 236 of file entity_model.c.

236 {
237 guMtxIdentF(mtx);
238 mtx[0][0] = 1.0f;
239 mtx[1][1] = 1.0f;
240 mtx[2][2] = -1.0f;
241 mtx[3][3] = 1.0f;
242}

Referenced by appendGfx_entity_model(), and draw_entity_model_E().

◆ appendGfx_entity_model()

void appendGfx_entity_model ( EntityModel * model)

Definition at line 244 of file entity_model.c.

244 {
245 Matrix4f mtx;
246 Matrix4f mtx2;
247 ImgFXTexture ifxImg;
248 Matrix4f imgfxMtx;
249
251 gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
252 if (!(model->flags & ENTITY_MODEL_FLAG_USE_IMAGE)) {
253 if (!(model->flags & ENTITY_MODEL_FLAG_10000)) {
254 gDPPipeSync(gMainGfxPos++);
255 gDPSetRenderMode(gMainGfxPos++, G_RM_TEX_EDGE, G_RM_TEX_EDGE2);
256 gDPSetPrimColor(gMainGfxPos++, 0, 0, 255, 255, 255, 255);
257 gDPSetCombineMode(gMainGfxPos++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
258 gDPSetAlphaCompare(gMainGfxPos++, G_AC_NONE);
259 gSPSetOtherMode(gMainGfxPos++, G_SETOTHERMODE_H, G_MDSFT_ALPHADITHER, 18, G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_POINT | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE);
260
262 case FALSE:
263 switch (model->renderMode) {
265 gSPDisplayList(gMainGfxPos++, Gfx_RM1_SURFACE_OPA);
266 break;
268 gSPDisplayList(gMainGfxPos++, Gfx_RM1_DECAL_OPA);
269 break;
271 gSPDisplayList(gMainGfxPos++, Gfx_RM1_INTERSECTING_OPA);
272 break;
274 gSPDisplayList(gMainGfxPos++, Gfx_RM1_ALPHATEST);
275 break;
279 gSPDisplayList(gMainGfxPos++, Gfx_RM1_SURFACE_XLU);
280 break;
282 gSPDisplayList(gMainGfxPos++, Gfx_RM1_SURFACE_XLU_NO_AA);
283 break;
286 gSPDisplayList(gMainGfxPos++, Gfx_RM1_DECAL_XLU);
287 break;
290 gSPDisplayList(gMainGfxPos++, Gfx_RM1_DECAL_XLU_NO_AA);
291 break;
293 gSPDisplayList(gMainGfxPos++, Gfx_RM1_INTERSECTING_XLU);
294 break;
296 gSPDisplayList(gMainGfxPos++, Gfx_RM1_PASS_THROUGH);
297 break;
299 gSPDisplayList(gMainGfxPos++, Gfx_RM1_ALPHATEST_ONESIDED);
300 break;
303 gSPDisplayList(gMainGfxPos++, Gfx_RM1_SURFACE_OPA_NO_ZB);
304 break;
307 gSPDisplayList(gMainGfxPos++, Gfx_RM1_ALPHATEST_NO_ZB);
308 break;
311 gSPDisplayList(gMainGfxPos++, Gfx_RM1_SURFACE_XLU_NO_ZB);
312 break;
314 gSPDisplayList(gMainGfxPos++, Gfx_RM1_CLOUD_NO_ZCMP);
315 break;
316 }
317 break;
318 case TRUE:
319 switch (model->renderMode) {
321 gSPDisplayList(gMainGfxPos++, Gfx_RM3_SURFACE_OPA);
322 break;
324 gSPDisplayList(gMainGfxPos++, Gfx_RM3_DECAL_OPA);
325 break;
327 gSPDisplayList(gMainGfxPos++, Gfx_RM3_INTERSECTING_OPA);
328 break;
330 gSPDisplayList(gMainGfxPos++, Gfx_RM3_ALPHATEST);
331 break;
333 gSPDisplayList(gMainGfxPos++, Gfx_RM3_SURFACE_XLU);
334 break;
336 gSPDisplayList(gMainGfxPos++, Gfx_RM3_DECAL_XLU);
337 break;
339 gSPDisplayList(gMainGfxPos++, Gfx_RM3_INTERSECTING_XLU);
340 break;
341 }
344 break;
345 }
346 gSPClearGeometryMode(gMainGfxPos++, G_LIGHTING);
348 gDPSetCombineMode(gMainGfxPos++, G_CC_MODULATEIA, G_CC_MODULATEIA);
349 } else {
350 gDPSetCombineMode(gMainGfxPos++, PM_CC_42, PM_CC2_MULTIPLY_SHADE);
351 }
352 }
353 if (model->vertexArray != NULL) {
355 }
356 gDPPipeSync(gMainGfxPos++);
357
358 if (model->fpSetupGfxCallback != NULL) {
360 }
361 gDPPipeSync(gMainGfxPos++);
362
363 gSPDisplayList(gMainGfxPos++, model->gfx.displayList);
364 gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
365 gDPPipeSync(gMainGfxPos++);
366
367 if (!(model->flags & ENTITY_MODEL_FLAG_REFLECT)) {
368 return;
369 }
370
371 guMtxL2F(mtx, &model->transform);
373 guMtxCatF(mtx, mtx2, mtx);
374 guMtxF2L(mtx, &model->transform);
376 gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
377 gSPDisplayList(gMainGfxPos++, model->gfx.displayList);
378 } else {
379 SpriteRasterInfo* imageData;
380
381 gDPPipeSync(gMainGfxPos++);
382 gSPClearGeometryMode(gMainGfxPos++, G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH);
383 gSPSetGeometryMode(gMainGfxPos++, G_ZBUFFER | G_SHADE | G_LIGHTING | G_SHADING_SMOOTH);
384 gSPSetLights1(gMainGfxPos++, D_8014C268);
385 gSPTexture(gMainGfxPos++, -1, -1, 0, G_TX_RENDERTILE, G_ON);
386 gDPSetAlphaCompare(gMainGfxPos++, G_AC_NONE);
387 gSPSetOtherMode(gMainGfxPos++, G_SETOTHERMODE_H, G_MDSFT_ALPHADITHER, 18, G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE);
388
389 imageData = model->gfx.imageData;
390 ifxImg.raster = imageData->raster;
391 ifxImg.palette = imageData->defaultPal;
392 ifxImg.width = imageData->width;
393 ifxImg.height = imageData->height;
394 ifxImg.xOffset = -imageData->width / 2;
395 ifxImg.yOffset = imageData->height / 2;
396 ifxImg.alpha = 255;
397 guMtxL2F(imgfxMtx, &model->transform);
398 imgfx_appendGfx_component(0, &ifxImg, 0, imgfxMtx);
399 }
400
401 gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
402 gDPPipeSync(gMainGfxPos++);
403}
Mtx matrixStack[0x200]
f32 Matrix4f[4][4]
#define guMtxF2L
#define guMtxCatF
Gfx Gfx_RM3_SURFACE_OPA[]
Definition model.c:1067
void make_entity_model_mtx_flipZ(Matrix4f mtx)
Gfx Gfx_RM3_DECAL_XLU[]
Definition model.c:1117
Gfx Gfx_RM3_DECAL_OPA[]
Definition model.c:1077
Gfx Gfx_RM1_SURFACE_XLU[]
Definition model.c:686
Gfx Gfx_RM1_DECAL_XLU[]
Definition model.c:696
Gfx Gfx_RM1_ALPHATEST_ONESIDED[]
Definition model.c:746
BSS s32 D_80154374
Lights1 D_8014C268
Definition entity_model.c:8
Gfx Gfx_RM1_SURFACE_XLU_NO_AA[]
Definition model.c:756
Gfx Gfx_RM1_DECAL_OPA[]
Definition model.c:654
Gfx Gfx_RM1_ALPHATEST[]
Definition model.c:676
Gfx Gfx_RM1_INTERSECTING_XLU[]
Definition model.c:706
Gfx Gfx_RM1_SURFACE_OPA[]
Definition model.c:643
Gfx Gfx_RM3_INTERSECTING_XLU[]
Definition model.c:1127
Gfx Gfx_RM1_ALPHATEST_NO_ZB[]
Definition model.c:810
Gfx Gfx_RM3_INTERSECTING_OPA[]
Definition model.c:1087
Gfx Gfx_RM1_CLOUD_NO_ZCMP[]
Definition model.c:844
Gfx Gfx_RM3_ALPHATEST[]
Definition model.c:1097
Gfx Gfx_RM1_SURFACE_OPA_NO_ZB[]
Definition model.c:800
Gfx Gfx_RM1_DECAL_XLU_NO_AA[]
Definition model.c:766
Gfx Gfx_RM1_PASS_THROUGH[]
Definition model.c:779
Gfx Gfx_RM1_SURFACE_XLU_NO_ZB[]
Definition model.c:820
Gfx Gfx_RM1_INTERSECTING_OPA[]
Definition model.c:665
Gfx Gfx_RM3_SURFACE_XLU[]
Definition model.c:1107
@ ENTITY_MODEL_FLAG_FOG_DISABLED
Definition enums.h:5021
@ ENTITY_MODEL_FLAG_10000
Definition enums.h:5026
@ ENTITY_MODEL_FLAG_REFLECT
Definition enums.h:5019
@ RENDER_MODE_ALPHATEST_ONESIDED
Definition enums.h:3278
@ RENDER_MODE_SURFACE_OPA_NO_ZB
Definition enums.h:3267
@ RENDER_MODE_DECAL_OPA
Definition enums.h:3268
@ RENDER_MODE_SURFACE_XLU_LAYER3
Definition enums.h:3299
@ RENDER_MODE_DECAL_XLU_NO_AA
Definition enums.h:3293
@ RENDER_MODE_SURFACE_XLU_LAYER2
Definition enums.h:3287
@ RENDER_MODE_SURFACE_XLU_NO_AA
Definition enums.h:3284
@ RENDER_MODE_INTERSECTING_XLU
Definition enums.h:3303
@ RENDER_MODE_PASS_THROUGH
Definition enums.h:3306
@ RENDER_MODE_DECAL_XLU
Definition enums.h:3291
@ RENDER_MODE_SHADOW
Definition enums.h:3297
@ RENDER_MODE_SURFACE_XLU_NO_ZB
Definition enums.h:3285
@ RENDER_MODE_SURFACE_XLU_NO_ZB_BEHIND
Definition enums.h:3310
@ RENDER_MODE_SURFACE_OPA_NO_ZB_BEHIND
Definition enums.h:3308
@ RENDER_MODE_DECAL_XLU_AHEAD
Definition enums.h:3295
@ RENDER_MODE_ALPHATEST_NO_ZB_BEHIND
Definition enums.h:3309
@ RENDER_MODE_INTERSECTING_OPA
Definition enums.h:3272
@ RENDER_MODE_ALPHATEST
Definition enums.h:3276
@ RENDER_MODE_SURFACE_OPA
Definition enums.h:3264
@ RENDER_MODE_ALPHATEST_NO_ZB
Definition enums.h:3279
@ RENDER_MODE_SURFACE_XLU_LAYER1
Definition enums.h:3282
@ RENDER_MODE_CLOUD_NO_ZCMP
Definition enums.h:3311
s32 imgfx_appendGfx_component(s32, ImgFXTexture *, u32, Matrix4f)
Definition imgfx.c:704
#define PM_CC2_MULTIPLY_SHADE
Definition macros.h:308
#define PM_CC_42
Definition macros.h:467
#define VIRTUAL_TO_PHYSICAL(addr)
Definition macros.h:47
void * setupGfxCallbackArg0
Definition entity.h:464
Mtx transform
Definition entity.h:460
Gfx * gMainGfxPos
Definition cam_main.c:15
u16 gMatrixListPos
Definition main_loop.c:45
DisplayContext * gDisplayContext
Definition cam_main.c:16

Referenced by draw_entity_model_A(), draw_entity_model_B(), draw_entity_model_C(), and draw_entity_model_D().

◆ draw_entity_model_A()

void draw_entity_model_A ( s32 modelIdx,
Mtx * transformMtx )

Definition at line 406 of file entity_model.c.

406 {
407 EntityModel* model;
408 RenderTask rt;
409 RenderTask* rtPtr = &rt;
410 Camera* camera = &gCameras[gCurrentCamID];
411 Matrix4f mtx;
412 f32 x, y, z, w;
413 f32 inX, inY, inZ;
414
415 if ((gGameStatusPtr->context == CONTEXT_WORLD) || (modelIdx & BATTLE_ENTITY_ID_BIT)) {
416 modelIdx &= ~BATTLE_ENTITY_ID_BIT;
417 model = (*gCurrentEntityModelList)[modelIdx];
418
419 if (model != NULL) {
420 if (model->flags != 0) {
421 if (!(model->flags & ENTITY_MODEL_FLAG_100)) {
422 if (!(model->flags & ENTITY_MODEL_FLAG_HIDDEN)) {
423 if (!(model->flags & ENTITY_MODEL_FLAG_40) && (model->flags & (1 << gCurrentCamID))) {
424 model->transform = *transformMtx;
425 model->vertexArray = NULL;
426 guMtxL2F(mtx, transformMtx);
427 inX = mtx[3][0];
428 inY = mtx[3][1];
429 inZ = mtx[3][2];
430 transform_point(camera->mtxPerspective, inX, inY, inZ, 1.0f, &x, &y, &z, &w);
431 rtPtr->renderMode = model->renderMode;
432 rtPtr->appendGfxArg = model;
433 rtPtr->appendGfx = (void(*)(void*))appendGfx_entity_model;
434 rtPtr->dist = ((u32)(model->flags & 0xF000) >> 8) + inZ;
435 queue_render_task(rtPtr);
436 }
437 }
438 }
439 }
440 }
441 }
442}
#define transform_point
#define queue_render_task
void appendGfx_entity_model(EntityModel *model)
@ ENTITY_MODEL_FLAG_100
Definition enums.h:5018
@ ENTITY_MODEL_FLAG_40
Definition enums.h:5016
Matrix4f mtxPerspective
void * appendGfxArg
void(* appendGfx)(void *)
Camera gCameras[4]
Definition cam_main.c:17
s16 gCurrentCamID
Definition cam_main.c:13

Referenced by btl_bonk_render(), render_entities(), render_shadows(), and virtual_entity_list_render_world().

◆ draw_entity_model_B()

void draw_entity_model_B ( s32 modelIdx,
Mtx * transformMtx,
s32 vertexSegment,
Vec3s * vertexArray )

Definition at line 444 of file entity_model.c.

444 {
445 EntityModel* model;
446 RenderTask rt;
447 RenderTask* rtPtr = &rt;
448 Camera* camera = &gCameras[gCurrentCamID];
449 Matrix4f mtx;
450 f32 x, y, z, w;
451 f32 inX, inY, inZ;
452
453 if ((gGameStatusPtr->context == CONTEXT_WORLD) || (modelIdx & BATTLE_ENTITY_ID_BIT)) {
454 modelIdx &= ~BATTLE_ENTITY_ID_BIT;
455 model = (*gCurrentEntityModelList)[modelIdx];
456
457 if (model != NULL) {
458 if (model->flags != 0) {
459 if (!(model->flags & ENTITY_MODEL_FLAG_100)) {
460 if (!(model->flags & ENTITY_MODEL_FLAG_HIDDEN)) {
461 if (model->flags & (1 << gCurrentCamID)) {
462 model->transform = *transformMtx;
463 D_80154374 = vertexSegment;
464 model->vertexArray = vertexArray;
465 guMtxL2F(mtx, transformMtx);
466 inX = mtx[3][0];
467 inY = mtx[3][1];
468 inZ = mtx[3][2];
469 transform_point(camera->mtxPerspective, inX, inY, inZ, 1.0f, &x, &y, &z, &w);
470 rtPtr->renderMode = model->renderMode;
471 rtPtr->appendGfxArg = model;
472 rtPtr->appendGfx = (void(*)(void*))appendGfx_entity_model;
473 rtPtr->dist = ((u32)(model->flags & 0xF000) >> 8) + inZ;
474 queue_render_task(rtPtr);
475 }
476 }
477 }
478 }
479 }
480 }
481}

Referenced by render_entities(), and render_shadows().

◆ draw_entity_model_C()

void draw_entity_model_C ( s32 modelIdx,
Mtx * transformMtx )

Definition at line 483 of file entity_model.c.

483 {
484 EntityModel* model;
485 RenderTask rt;
486 RenderTask* rtPtr = &rt;
487
488 if ((gGameStatusPtr->context == CONTEXT_WORLD) || (modelIdx & BATTLE_ENTITY_ID_BIT)) {
489 modelIdx &= ~BATTLE_ENTITY_ID_BIT;
490 model = (*gCurrentEntityModelList)[modelIdx];
491
492 if (model != NULL) {
493 if (model->flags != 0) {
494 if (!(model->flags & ENTITY_MODEL_FLAG_100)) {
495 if (!(model->flags & ENTITY_MODEL_FLAG_HIDDEN)) {
496 if (!(model->flags & ENTITY_MODEL_FLAG_40) && (model->flags & (1 << gCurrentCamID))) {
498 model->transform = *transformMtx;
499 model->vertexArray = NULL;
500 rtPtr->renderMode = model->renderMode;
501 rtPtr->appendGfxArg = model;
502 rtPtr->appendGfx = (void(*)(void*))appendGfx_entity_model;
503 rtPtr->dist = (u32)(model->flags & 0xF000) >> 8;
504 queue_render_task(rtPtr);
505 }
506 }
507 }
508 }
509 }
510 }
511}

◆ draw_entity_model_D()

void draw_entity_model_D ( s32 modelIdx,
Mtx * transformMtx,
s32 arg2,
Vec3s * vertexArray )

Definition at line 513 of file entity_model.c.

513 {
514 EntityModel* model;
515 RenderTask rt;
516 RenderTask* rtPtr = &rt;
517
518 if ((gGameStatusPtr->context == CONTEXT_WORLD) || (modelIdx & BATTLE_ENTITY_ID_BIT)) {
519 modelIdx &= ~BATTLE_ENTITY_ID_BIT;
520 model = (*gCurrentEntityModelList)[modelIdx];
521
522 if (model != NULL) {
523 if (model->flags != 0) {
524 if (!(model->flags & ENTITY_MODEL_FLAG_100)) {
525 if (!(model->flags & ENTITY_MODEL_FLAG_HIDDEN)) {
526 if (model->flags & (1 << gCurrentCamID)) {
528 model->transform = *transformMtx;
529 D_80154374 = arg2;
530 model->vertexArray = vertexArray;
531 rtPtr->renderMode = model->renderMode;
532 rtPtr->appendGfxArg = model;
533 rtPtr->appendGfx = (void(*)(void*))appendGfx_entity_model;
534 rtPtr->dist = (u32)(model->flags & 0xF000) >> 8;
535 queue_render_task(rtPtr);
536 }
537 }
538 }
539 }
540 }
541 }
542}

◆ draw_entity_model_E()

void draw_entity_model_E ( s32 modelIdx,
Mtx * transformMtx )

Definition at line 544 of file entity_model.c.

544 {
545 EntityModel* model = (*gCurrentEntityModelList)[modelIdx & ~BATTLE_ENTITY_ID_BIT];
546 Matrix4f mtx;
547 Matrix4f mtx2;
548 ImgFXTexture ifxImg;
549 Matrix4f imgfxMtx;
550
551 if (model == NULL) {
552 return;
553 }
554 if (model->flags == 0) {
555 return;
556 }
557 if (model->flags & ENTITY_MODEL_FLAG_100) {
558 return;
559 }
560 if (model->flags & ENTITY_MODEL_FLAG_HIDDEN) {
561 return;
562 }
563 if (model->flags & ENTITY_MODEL_FLAG_40) {
564 return;
565 }
566 if (!(model->flags & ENTITY_MODEL_FLAG_CAM3)) {
567 return;
568 }
569
570 model->transform = *transformMtx;
571 model->vertexArray = NULL;
573 gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
574 if (!(model->flags & ENTITY_MODEL_FLAG_USE_IMAGE)) {
576 case FALSE:
577 switch (model->renderMode) {
579 gSPDisplayList(gMainGfxPos++, Gfx_RM1_SURFACE_OPA);
580 break;
582 gSPDisplayList(gMainGfxPos++, Gfx_RM1_DECAL_OPA);
583 break;
585 gSPDisplayList(gMainGfxPos++, Gfx_RM1_INTERSECTING_OPA);
586 break;
588 gSPDisplayList(gMainGfxPos++, Gfx_RM1_ALPHATEST);
589 break;
593 gSPDisplayList(gMainGfxPos++, Gfx_RM1_SURFACE_XLU);
594 break;
596 gSPDisplayList(gMainGfxPos++, Gfx_RM1_SURFACE_XLU_NO_AA);
597 break;
600 gSPDisplayList(gMainGfxPos++, Gfx_RM1_DECAL_XLU);
601 break;
604 gSPDisplayList(gMainGfxPos++, Gfx_RM1_DECAL_XLU_NO_AA);
605 break;
607 gSPDisplayList(gMainGfxPos++, Gfx_RM1_INTERSECTING_XLU);
608 break;
610 gSPDisplayList(gMainGfxPos++, Gfx_RM1_PASS_THROUGH);
611 break;
613 gSPDisplayList(gMainGfxPos++, Gfx_RM1_ALPHATEST_ONESIDED);
614 break;
617 gSPDisplayList(gMainGfxPos++, Gfx_RM1_SURFACE_OPA_NO_ZB);
618 break;
621 gSPDisplayList(gMainGfxPos++, Gfx_RM1_ALPHATEST_NO_ZB);
622 break;
625 gSPDisplayList(gMainGfxPos++, Gfx_RM1_SURFACE_XLU_NO_ZB);
626 break;
628 gSPDisplayList(gMainGfxPos++, Gfx_RM1_CLOUD_NO_ZCMP);
629 break;
630 }
631 break;
632 case TRUE:
633 switch (model->renderMode) {
635 gSPDisplayList(gMainGfxPos++, Gfx_RM3_SURFACE_OPA);
636 break;
638 gSPDisplayList(gMainGfxPos++, Gfx_RM3_DECAL_OPA);
639 break;
641 gSPDisplayList(gMainGfxPos++, Gfx_RM3_INTERSECTING_OPA);
642 break;
644 gSPDisplayList(gMainGfxPos++, Gfx_RM3_ALPHATEST);
645 break;
647 gSPDisplayList(gMainGfxPos++, Gfx_RM3_SURFACE_XLU);
648 break;
650 gSPDisplayList(gMainGfxPos++, Gfx_RM3_DECAL_XLU);
651 break;
653 gSPDisplayList(gMainGfxPos++, Gfx_RM3_INTERSECTING_XLU);
654 break;
655 }
658 break;
659 }
660 gSPClearGeometryMode(gMainGfxPos++, G_LIGHTING);
662 gDPSetCombineMode(gMainGfxPos++, G_CC_MODULATEIA, G_CC_MODULATEIA);
663 } else {
664 gDPSetCombineMode(gMainGfxPos++, PM_CC_42, PM_CC2_MULTIPLY_SHADE);
665 }
666 if (model->vertexArray != NULL) {
668 }
669 gSPDisplayList(gMainGfxPos++, model->gfx.displayList);
670 gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
671 gDPPipeSync(gMainGfxPos++);
672 if (!(model->flags & ENTITY_MODEL_FLAG_REFLECT)) {
673 return;
674 }
675
676 guMtxL2F(mtx, &model->transform);
678 guMtxCatF(mtx, mtx2, mtx);
679 guMtxF2L(mtx, &model->transform);
681 gSPMatrix(gMainGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
682 gSPDisplayList(gMainGfxPos++, model->gfx.displayList);
683 } else {
684 SpriteRasterInfo* imageData;
685
686 gDPPipeSync(gMainGfxPos++);
687 gSPClearGeometryMode(gMainGfxPos++, G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH);
688 gSPSetGeometryMode(gMainGfxPos++, G_ZBUFFER | G_SHADE | G_LIGHTING | G_SHADING_SMOOTH);
689 gSPSetLights1(gMainGfxPos++, D_8014C268);
690 gSPTexture(gMainGfxPos++, -1, -1, 0, G_TX_RENDERTILE, G_ON);
691 gDPSetAlphaCompare(gMainGfxPos++, G_AC_NONE);
692 gSPSetOtherMode(gMainGfxPos++, G_SETOTHERMODE_H, G_MDSFT_ALPHADITHER, 18, G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE);
693
694 imageData = model->gfx.imageData;
695 ifxImg.raster = imageData->raster;
696 ifxImg.palette = imageData->defaultPal;
697 ifxImg.width = imageData->width;
698 ifxImg.height = imageData->height;
699 ifxImg.xOffset = -imageData->width / 2;
700 ifxImg.yOffset = imageData->height / 2;
701 ifxImg.alpha = 255;
702 guMtxL2F(imgfxMtx, &model->transform);
703 imgfx_appendGfx_component(0, &ifxImg, 0, imgfxMtx);
704 }
705
706 gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
707 gDPPipeSync(gMainGfxPos++);
708}
@ ENTITY_MODEL_FLAG_CAM3
Definition enums.h:5013

Referenced by virtual_entity_list_render_UI().

◆ set_entity_model_render_command_list()

void set_entity_model_render_command_list ( s32 idx,
EntityModelScript * cmdList )

Definition at line 710 of file entity_model.c.

710 {
711 EntityModel* entityModel = (*gCurrentEntityModelList)[idx & ~BATTLE_ENTITY_ID_BIT];
712
713 if (entityModel != NULL && entityModel->flags) {
714 if (cmdList == NULL) {
715 cmdList = &D_8014C260;
716 }
717 entityModel->cmdListReadPos = cmdList;
718 entityModel->cmdListSavedPos = cmdList;
719 entityModel->nextFrameTime = 1.0f;
720 entityModel->timeScale = 1.0f;
721 }
722}

Referenced by entity_set_render_script().

◆ get_entity_model()

EntityModel * get_entity_model ( s32 listIndex)

Definition at line 724 of file entity_model.c.

724 {
725 return (*gCurrentEntityModelList)[listIndex & ~BATTLE_ENTITY_ID_BIT];
726}

Referenced by render_entities(), update_npcs(), virtual_entity_list_render_UI(), and virtual_entity_list_render_world().

◆ free_entity_model_by_index()

void free_entity_model_by_index ( s32 idx)

Definition at line 728 of file entity_model.c.

728 {
729 s32 index = idx & ~BATTLE_ENTITY_ID_BIT;
730 EntityModel* entityModel = (*gCurrentEntityModelList)[index];
731
732 if (entityModel != NULL && entityModel->flags) {
733 if (entityModel->flags & ENTITY_MODEL_FLAG_USE_IMAGE) {
734 heap_free(entityModel->gfx.imageData);
735 }
736 {
737 s32* modelCount = &gEntityModelCount;
739 (*gCurrentEntityModelList)[index] = NULL;
740 (*modelCount)--;
741 }
742 }
743}
s32 heap_free(void *ptr)
Definition heap.c:42

Referenced by btl_bonk_update(), delete_entity(), delete_entity_and_unload_data(), delete_shadow(), free_entity_model_by_ref(), and virtual_entity_delete_by_index().

◆ set_entity_model_flags()

void set_entity_model_flags ( s32 idx,
s32 newFlags )

Definition at line 759 of file entity_model.c.

759 {
760 EntityModel* entityModel = (*gCurrentEntityModelList)[idx & ~BATTLE_ENTITY_ID_BIT];
761
762 if (entityModel != NULL && entityModel->flags) {
763 entityModel->flags |= newFlags;
764 }
765}

Referenced by show_immune_bonk().

◆ clear_entity_model_flags()

void clear_entity_model_flags ( s32 idx,
s32 newFlags )

Definition at line 767 of file entity_model.c.

767 {
768 EntityModel* entityModel = (*gCurrentEntityModelList)[idx & ~BATTLE_ENTITY_ID_BIT];
769
770 if (entityModel != NULL && entityModel->flags) {
771 entityModel->flags &= ~newFlags;
772 }
773}

Referenced by btl_bonk_update().

◆ bind_entity_model_setupGfx()

void bind_entity_model_setupGfx ( s32 idx,
void * setupGfxCallbackArg0,
void(*)(void *) fpSetupGfxCallback )

Definition at line 775 of file entity_model.c.

775 {
776 EntityModel* entityModel = (*gCurrentEntityModelList)[idx & ~BATTLE_ENTITY_ID_BIT];
777
778 entityModel->fpSetupGfxCallback = fpSetupGfxCallback;
779 entityModel->setupGfxCallbackArg0 = setupGfxCallbackArg0;
780}

Referenced by render_entities(), render_shadows(), and show_immune_bonk().

◆ func_80122F8C()

void func_80122F8C ( s32 idx,
s32 newFlags )

Definition at line 782 of file entity_model.c.

782 {
783 EntityModel* entityModel = (*gCurrentEntityModelList)[idx & ~BATTLE_ENTITY_ID_BIT];
784
785 entityModel->flags |= newFlags;
786}

◆ func_80122FB8()

void func_80122FB8 ( s32 idx,
s32 newFlags )

Definition at line 788 of file entity_model.c.

788 {
789 EntityModel* entityModel = (*gCurrentEntityModelList)[idx & ~BATTLE_ENTITY_ID_BIT];
790
792}

◆ enable_entity_fog()

void enable_entity_fog ( void )

Definition at line 794 of file entity_model.c.

794 {
796}

◆ disable_entity_fog()

void disable_entity_fog ( void )

Definition at line 798 of file entity_model.c.

798 {
800}

◆ set_entity_fog_dist()

void set_entity_fog_dist ( s32 min,
s32 max )

Definition at line 802 of file entity_model.c.

802 {
805}

◆ set_entity_fog_color()

void set_entity_fog_color ( s32 r,
s32 g,
s32 b,
s32 a )

Definition at line 807 of file entity_model.c.

807 {
808 entity_fog_red = r;
810 entity_fog_blue = b;
812}

◆ is_entity_fog_enabled()

s32 is_entity_fog_enabled ( void )

Definition at line 814 of file entity_model.c.

814 {
815 return entity_fog_enabled;
816}

◆ get_entity_fog_distance()

void get_entity_fog_distance ( s32 * start,
s32 * end )

Definition at line 818 of file entity_model.c.

818 {
819 *start = entity_fog_dist_min;
820 *end = entity_fog_dist_max;
821}

◆ get_entity_fog_color()

void get_entity_fog_color ( s32 * r,
s32 * g,
s32 * b,
s32 * a )

Definition at line 823 of file entity_model.c.

823 {
824 *r = entity_fog_red;
825 *g = entity_fog_green;
826 *b = entity_fog_blue;
827 *a = entity_fog_alpha;
828}

Variable Documentation

◆ D_8014C260

EntityModelScript D_8014C260
Initial value:
= {
}
#define ems_End
Definition entity.h:47

Definition at line 4 of file entity_model.c.

4 {
7};

Referenced by ALT_load_entity_model(), load_entity_model(), and set_entity_model_render_command_list().

◆ D_8014C268

Lights1 D_8014C268 = gdSPDefLights1(255, 255, 255, 0, 0, 0, 0, 0, 0)

Definition at line 8 of file entity_model.c.

Referenced by appendGfx_entity_model(), and draw_entity_model_E().

◆ gEntityModelCount

◆ gWorldEntityModelList

BSS EntityModelList gWorldEntityModelList

Definition at line 12 of file entity_model.c.

Referenced by clear_entity_models(), and init_entity_models().

◆ gBattleEntityModelList

BSS EntityModelList gBattleEntityModelList

Definition at line 13 of file entity_model.c.

Referenced by clear_entity_models(), and init_entity_models().

◆ gCurrentEntityModelList

◆ D_80154374

BSS s32 D_80154374

◆ entity_fog_enabled

◆ entity_fog_red

◆ entity_fog_green

◆ entity_fog_blue

◆ entity_fog_alpha

◆ entity_fog_dist_min

◆ entity_fog_dist_max

◆ Gfx_RM1_SURFACE_OPA

Gfx Gfx_RM1_SURFACE_OPA[]
extern

Definition at line 643 of file model.c.

643 {
644 gsDPSetRenderMode(G_RM_AA_ZB_OPA_SURF, G_RM_AA_ZB_OPA_SURF2),
645 gsDPSetCycleType(G_CYC_1CYCLE),
646 gsSPClearGeometryMode(G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD |
647 G_SHADING_SMOOTH),
648 gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
649 gsSPEndDisplayList(),
650};

Referenced by appendGfx_entity_model(), and draw_entity_model_E().

◆ Gfx_RM1_DECAL_OPA

Gfx Gfx_RM1_DECAL_OPA[]
extern

Definition at line 654 of file model.c.

654 {
655 gsDPSetRenderMode(G_RM_AA_ZB_OPA_DECAL, G_RM_AA_ZB_OPA_DECAL2),
656 gsDPSetCycleType(G_CYC_1CYCLE),
657 gsSPClearGeometryMode(G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD |
658 G_SHADING_SMOOTH),
659 gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
660 gsSPEndDisplayList(),
661};

Referenced by appendGfx_entity_model(), and draw_entity_model_E().

◆ Gfx_RM1_INTERSECTING_OPA

Gfx Gfx_RM1_INTERSECTING_OPA[]
extern

Definition at line 665 of file model.c.

665 {
666 gsDPSetRenderMode(G_RM_AA_ZB_OPA_INTER, G_RM_AA_ZB_OPA_INTER2),
667 gsDPSetCycleType(G_CYC_1CYCLE),
668 gsSPClearGeometryMode(G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD |
669 G_SHADING_SMOOTH),
670 gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
671 gsSPEndDisplayList(),
672};

Referenced by appendGfx_entity_model(), and draw_entity_model_E().

◆ Gfx_RM1_ALPHATEST

Gfx Gfx_RM1_ALPHATEST[]
extern

Definition at line 676 of file model.c.

676 {
677 gsDPSetRenderMode(G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2),
678 gsDPSetCycleType(G_CYC_1CYCLE),
679 gsSPClearGeometryMode(G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
680 gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_LIGHTING | G_SHADING_SMOOTH),
681 gsSPEndDisplayList(),
682};

Referenced by appendGfx_entity_model(), and draw_entity_model_E().

◆ Gfx_RM1_SURFACE_XLU

Gfx Gfx_RM1_SURFACE_XLU[]
extern

Definition at line 686 of file model.c.

686 {
687 gsDPSetRenderMode(G_RM_AA_ZB_XLU_SURF, G_RM_AA_ZB_XLU_SURF2),
688 gsDPSetCycleType(G_CYC_1CYCLE),
689 gsSPClearGeometryMode(G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
690 gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_LIGHTING | G_SHADING_SMOOTH),
691 gsSPEndDisplayList(),
692};

Referenced by appendGfx_entity_model(), and draw_entity_model_E().

◆ Gfx_RM1_DECAL_XLU

Gfx Gfx_RM1_DECAL_XLU[]
extern

Definition at line 696 of file model.c.

696 {
697 gsDPSetRenderMode(G_RM_AA_ZB_XLU_DECAL, G_RM_AA_ZB_XLU_DECAL2),
698 gsDPSetCycleType(G_CYC_1CYCLE),
699 gsSPClearGeometryMode(G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
700 gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_LIGHTING | G_SHADING_SMOOTH),
701 gsSPEndDisplayList(),
702};

Referenced by appendGfx_entity_model(), and draw_entity_model_E().

◆ Gfx_RM1_INTERSECTING_XLU

Gfx Gfx_RM1_INTERSECTING_XLU[]
extern

Definition at line 706 of file model.c.

706 {
707 gsDPSetRenderMode(G_RM_AA_ZB_XLU_INTER, G_RM_AA_ZB_XLU_INTER2),
708 gsDPSetCycleType(G_CYC_1CYCLE),
709 gsSPClearGeometryMode(G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
710 gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_LIGHTING | G_SHADING_SMOOTH),
711 gsSPEndDisplayList(),
712};

Referenced by appendGfx_entity_model(), and draw_entity_model_E().

◆ Gfx_RM1_ALPHATEST_ONESIDED

Gfx Gfx_RM1_ALPHATEST_ONESIDED
extern
Initial value:
= {
gsDPSetRenderMode(G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2),
gsDPSetCycleType(G_CYC_1CYCLE),
gsSPClearGeometryMode(G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
}

Definition at line 746 of file model.c.

746 {
747 gsDPSetRenderMode(G_RM_AA_ZB_TEX_EDGE, G_RM_AA_ZB_TEX_EDGE2),
748 gsDPSetCycleType(G_CYC_1CYCLE),
749 gsSPClearGeometryMode(G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
750 gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
751 gsSPEndDisplayList(),
752};

Referenced by appendGfx_entity_model(), and draw_entity_model_E().

◆ Gfx_RM1_SURFACE_XLU_NO_AA

Gfx Gfx_RM1_SURFACE_XLU_NO_AA
extern
Initial value:
= {
gsDPSetRenderMode(G_RM_ZB_XLU_SURF, G_RM_ZB_XLU_SURF2),
gsDPSetCycleType(G_CYC_1CYCLE),
gsSPClearGeometryMode(G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
}

Definition at line 756 of file model.c.

756 {
757 gsDPSetRenderMode(G_RM_ZB_XLU_SURF, G_RM_ZB_XLU_SURF2),
758 gsDPSetCycleType(G_CYC_1CYCLE),
759 gsSPClearGeometryMode(G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
760 gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_LIGHTING | G_SHADING_SMOOTH),
761 gsSPEndDisplayList(),
762};

Referenced by appendGfx_entity_model(), and draw_entity_model_E().

◆ Gfx_RM1_DECAL_XLU_NO_AA

Gfx Gfx_RM1_DECAL_XLU_NO_AA
extern
Initial value:
= {
gsDPSetRenderMode(G_RM_ZB_OVL_SURF, G_RM_ZB_OVL_SURF2),
gsDPSetCycleType(G_CYC_1CYCLE),
gsSPClearGeometryMode(G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
}

Definition at line 766 of file model.c.

766 {
767 gsDPSetRenderMode(G_RM_ZB_OVL_SURF, G_RM_ZB_OVL_SURF2),
768 gsDPSetCycleType(G_CYC_1CYCLE),
769 gsSPClearGeometryMode(G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
770 gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_LIGHTING | G_SHADING_SMOOTH),
771 gsSPEndDisplayList(),
772};

Referenced by appendGfx_entity_model(), and draw_entity_model_E().

◆ Gfx_RM1_PASS_THROUGH

Gfx Gfx_RM1_PASS_THROUGH
extern
Initial value:
= {
gsDPSetCycleType(G_CYC_1CYCLE),
gsSPClearGeometryMode(G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
}

Definition at line 779 of file model.c.

779 {
780 gsDPSetCycleType(G_CYC_1CYCLE),
781 gsSPClearGeometryMode(G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
782 gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_LIGHTING | G_SHADING_SMOOTH),
783 gsSPEndDisplayList(),
784};

Referenced by appendGfx_entity_model(), and draw_entity_model_E().

◆ Gfx_RM1_SURFACE_OPA_NO_ZB

Gfx Gfx_RM1_SURFACE_OPA_NO_ZB
extern
Initial value:
= {
gsDPSetRenderMode(G_RM_AA_OPA_SURF, G_RM_AA_OPA_SURF2),
gsDPSetCycleType(G_CYC_1CYCLE),
gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
gsSPSetGeometryMode(G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
}

Definition at line 800 of file model.c.

800 {
801 gsDPSetRenderMode(G_RM_AA_OPA_SURF, G_RM_AA_OPA_SURF2),
802 gsDPSetCycleType(G_CYC_1CYCLE),
803 gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
804 gsSPSetGeometryMode(G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
805 gsSPEndDisplayList(),
806};

Referenced by appendGfx_entity_model(), and draw_entity_model_E().

◆ Gfx_RM1_ALPHATEST_NO_ZB

Gfx Gfx_RM1_ALPHATEST_NO_ZB
extern
Initial value:
= {
gsDPSetRenderMode(G_RM_AA_TEX_EDGE, G_RM_AA_TEX_EDGE2),
gsDPSetCycleType(G_CYC_1CYCLE),
gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
gsSPSetGeometryMode(G_SHADE | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
}

Definition at line 810 of file model.c.

810 {
811 gsDPSetRenderMode(G_RM_AA_TEX_EDGE, G_RM_AA_TEX_EDGE2),
812 gsDPSetCycleType(G_CYC_1CYCLE),
813 gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
814 gsSPSetGeometryMode(G_SHADE | G_LIGHTING | G_SHADING_SMOOTH),
815 gsSPEndDisplayList(),
816};

Referenced by appendGfx_entity_model(), and draw_entity_model_E().

◆ Gfx_RM1_SURFACE_XLU_NO_ZB

Gfx Gfx_RM1_SURFACE_XLU_NO_ZB
extern
Initial value:
= {
gsDPSetRenderMode(G_RM_AA_XLU_SURF, G_RM_AA_XLU_SURF2),
gsDPSetCycleType(G_CYC_1CYCLE),
gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
gsSPSetGeometryMode(G_SHADE | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
}

Definition at line 820 of file model.c.

820 {
821 gsDPSetRenderMode(G_RM_AA_XLU_SURF, G_RM_AA_XLU_SURF2),
822 gsDPSetCycleType(G_CYC_1CYCLE),
823 gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
824 gsSPSetGeometryMode(G_SHADE | G_LIGHTING | G_SHADING_SMOOTH),
825 gsSPEndDisplayList(),
826};

Referenced by appendGfx_entity_model(), and draw_entity_model_E().

◆ Gfx_RM1_CLOUD_NO_ZCMP

Gfx Gfx_RM1_CLOUD_NO_ZCMP
extern
Initial value:
= {
gsDPSetRenderMode(IM_RD | CVG_DST_SAVE | ZMODE_XLU | FORCE_BL |
GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA),
IM_RD | CVG_DST_SAVE | ZMODE_XLU | FORCE_BL |
GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)),
gsDPSetCycleType(G_CYC_1CYCLE),
gsSPClearGeometryMode(G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_LIGHTING | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
}

Definition at line 844 of file model.c.

844 {
845 gsDPSetRenderMode(IM_RD | CVG_DST_SAVE | ZMODE_XLU | FORCE_BL |
846 GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA),
847 IM_RD | CVG_DST_SAVE | ZMODE_XLU | FORCE_BL |
848 GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA)),
849 gsDPSetCycleType(G_CYC_1CYCLE),
850 gsSPClearGeometryMode(G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
851 gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_LIGHTING | G_SHADING_SMOOTH),
852 gsSPEndDisplayList(),
853};

Referenced by appendGfx_entity_model(), and draw_entity_model_E().

◆ Gfx_RM3_SURFACE_OPA

Gfx Gfx_RM3_SURFACE_OPA[]
extern

Definition at line 1067 of file model.c.

1067 {
1068 gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_SURF2),
1069 gsDPSetCycleType(G_CYC_2CYCLE),
1070 gsSPClearGeometryMode(G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
1071 gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
1072 gsSPEndDisplayList(),
1073};

Referenced by appendGfx_entity_model(), and draw_entity_model_E().

◆ Gfx_RM3_DECAL_OPA

Gfx Gfx_RM3_DECAL_OPA[]
extern

Definition at line 1077 of file model.c.

1077 {
1078 gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_DECAL2),
1079 gsDPSetCycleType(G_CYC_2CYCLE),
1080 gsSPClearGeometryMode(G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
1081 gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
1082 gsSPEndDisplayList(),
1083};

Referenced by appendGfx_entity_model(), and draw_entity_model_E().

◆ Gfx_RM3_INTERSECTING_OPA

Gfx Gfx_RM3_INTERSECTING_OPA[]
extern

Definition at line 1087 of file model.c.

1087 {
1088 gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_OPA_INTER2),
1089 gsDPSetCycleType(G_CYC_2CYCLE),
1090 gsSPClearGeometryMode(G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
1091 gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
1092 gsSPEndDisplayList(),
1093};

Referenced by appendGfx_entity_model(), and draw_entity_model_E().

◆ Gfx_RM3_ALPHATEST

Gfx Gfx_RM3_ALPHATEST[]
extern

Definition at line 1097 of file model.c.

1097 {
1098 gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_TEX_EDGE2),
1099 gsDPSetCycleType(G_CYC_2CYCLE),
1100 gsSPClearGeometryMode(G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
1101 gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
1102 gsSPEndDisplayList(),
1103};

Referenced by appendGfx_entity_model(), and draw_entity_model_E().

◆ Gfx_RM3_SURFACE_XLU

Gfx Gfx_RM3_SURFACE_XLU[]
extern

Definition at line 1107 of file model.c.

1107 {
1108 gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_XLU_SURF2),
1109 gsDPSetCycleType(G_CYC_2CYCLE),
1110 gsSPClearGeometryMode(G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
1111 gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
1112 gsSPEndDisplayList(),
1113};

Referenced by appendGfx_entity_model(), and draw_entity_model_E().

◆ Gfx_RM3_DECAL_XLU

Gfx Gfx_RM3_DECAL_XLU[]
extern

Definition at line 1117 of file model.c.

1117 {
1118 gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_XLU_DECAL2),
1119 gsDPSetCycleType(G_CYC_2CYCLE),
1120 gsSPClearGeometryMode(G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
1121 gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
1122 gsSPEndDisplayList(),
1123};

Referenced by appendGfx_entity_model(), and draw_entity_model_E().

◆ Gfx_RM3_INTERSECTING_XLU

Gfx Gfx_RM3_INTERSECTING_XLU[]
extern

Definition at line 1127 of file model.c.

1127 {
1128 gsDPSetRenderMode(G_RM_FOG_SHADE_A, G_RM_AA_ZB_XLU_INTER2),
1129 gsDPSetCycleType(G_CYC_2CYCLE),
1130 gsSPClearGeometryMode(G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
1131 gsSPSetGeometryMode(G_ZBUFFER | G_SHADE | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
1132 gsSPEndDisplayList(),
1133};

Referenced by appendGfx_entity_model(), and draw_entity_model_E().