8Lights1
D_8014C268 = gdSPDefLights1(255, 255, 255, 0, 0, 0, 0, 0, 0);
61 (*gCurrentEntityModelList)[i] = NULL;
95 s32* entityModelCount;
105 (*gCurrentEntityModelList)[i] = newEntityModel =
heap_malloc(
sizeof(*newEntityModel));
107 (*entityModelCount)++;
109 ASSERT(newEntityModel != NULL);
113 newEntityModel->
gfx.displayList = NULL;
117 if (cmdList == NULL) {
143 s32* entityModelCount;
144 (*gCurrentEntityModelList)[i] = newEntityModel =
heap_malloc(
sizeof(*newEntityModel));
146 (*entityModelCount)++;
149 ASSERT(newEntityModel != NULL);
151 newEntityModel->
gfx.imageData = imageData =
heap_malloc(
sizeof(*imageData));
152 ASSERT(imageData != NULL);
159 if (cmdList == NULL) {
176 idx &= ~BATTLE_ENTITY_ID_BIT;
177 entityModel = (*gCurrentEntityModelList)[idx];
178 if (entityModel != NULL && (entityModel->
flags)) {
181 entityModel->
flags &= ~ENTITY_MODEL_FLAG_100;
202 entityModel->
gfx.displayList = (Gfx*) *curPos++;
216 entityModel->
flags |= *curPos++;
220 entityModel->
flags &= ~*curPos++;
224 imageData = entityModel->
gfx.imageData;
226 imageData->
raster = (u8*)*curPos++;
228 imageData->
width = *curPos++;
229 imageData->
height = *curPos++;
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);
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);
348 gDPSetCombineMode(
gMainGfxPos++, G_CC_MODULATEIA, G_CC_MODULATEIA);
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);
385 gSPTexture(
gMainGfxPos++, -1, -1, 0, G_TX_RENDERTILE, G_ON);
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);
389 imageData = model->
gfx.imageData;
416 modelIdx &= ~BATTLE_ENTITY_ID_BIT;
417 model = (*gCurrentEntityModelList)[modelIdx];
420 if (model->
flags != 0) {
426 guMtxL2F(mtx, transformMtx);
434 rtPtr->
dist = ((u32)(model->
flags & 0xF000) >> 8) + inZ;
454 modelIdx &= ~BATTLE_ENTITY_ID_BIT;
455 model = (*gCurrentEntityModelList)[modelIdx];
458 if (model->
flags != 0) {
465 guMtxL2F(mtx, transformMtx);
473 rtPtr->
dist = ((u32)(model->
flags & 0xF000) >> 8) + inZ;
489 modelIdx &= ~BATTLE_ENTITY_ID_BIT;
490 model = (*gCurrentEntityModelList)[modelIdx];
493 if (model->
flags != 0) {
503 rtPtr->
dist = (u32)(model->
flags & 0xF000) >> 8;
519 modelIdx &= ~BATTLE_ENTITY_ID_BIT;
520 model = (*gCurrentEntityModelList)[modelIdx];
523 if (model->
flags != 0) {
534 rtPtr->
dist = (u32)(model->
flags & 0xF000) >> 8;
545 EntityModel* model = (*gCurrentEntityModelList)[modelIdx & ~BATTLE_ENTITY_ID_BIT];
554 if (model->
flags == 0) {
662 gDPSetCombineMode(
gMainGfxPos++, G_CC_MODULATEIA, G_CC_MODULATEIA);
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);
690 gSPTexture(
gMainGfxPos++, -1, -1, 0, G_TX_RENDERTILE, G_ON);
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);
694 imageData = model->
gfx.imageData;
711 EntityModel* entityModel = (*gCurrentEntityModelList)[idx & ~BATTLE_ENTITY_ID_BIT];
713 if (entityModel != NULL && entityModel->
flags) {
714 if (cmdList == NULL) {
729 s32 index = idx & ~BATTLE_ENTITY_ID_BIT;
730 EntityModel* entityModel = (*gCurrentEntityModelList)[index];
732 if (entityModel != NULL && entityModel->
flags) {
739 (*gCurrentEntityModelList)[index] = NULL;
760 EntityModel* entityModel = (*gCurrentEntityModelList)[idx & ~BATTLE_ENTITY_ID_BIT];
762 if (entityModel != NULL && entityModel->
flags) {
763 entityModel->
flags |= newFlags;
768 EntityModel* entityModel = (*gCurrentEntityModelList)[idx & ~BATTLE_ENTITY_ID_BIT];
770 if (entityModel != NULL && entityModel->
flags) {
771 entityModel->
flags &= ~newFlags;
776 EntityModel* entityModel = (*gCurrentEntityModelList)[idx & ~BATTLE_ENTITY_ID_BIT];
783 EntityModel* entityModel = (*gCurrentEntityModelList)[idx & ~BATTLE_ENTITY_ID_BIT];
785 entityModel->
flags |= newFlags;
789 EntityModel* entityModel = (*gCurrentEntityModelList)[idx & ~BATTLE_ENTITY_ID_BIT];
#define queue_render_task
#define ASSERT(condition)
@ ENTITY_MODEL_SCRIPT_OP_SetFlags
@ ENTITY_MODEL_SCRIPT_OP_Draw
@ ENTITY_MODEL_SCRIPT_OP_Loop
@ ENTITY_MODEL_SCRIPT_OP_SetRenderMode
@ ENTITY_MODEL_SCRIPT_OP_Restart
@ ENTITY_MODEL_SCRIPT_OP_End
@ ENTITY_MODEL_SCRIPT_OP_DrawImage
@ ENTITY_MODEL_SCRIPT_OP_ClearFlags
EntityModel * EntityModelList[256]
Gfx Gfx_RM3_SURFACE_OPA[]
void enable_entity_fog(void)
void make_entity_model_mtx_flipZ(Matrix4f mtx)
BSS EntityModelList * gCurrentEntityModelList
s32 step_entity_model_commandlist(EntityModel *entityModel)
void init_entity_models(void)
EntityModel * get_entity_model(s32 listIndex)
void clear_entity_model_flags(s32 idx, s32 newFlags)
BSS EntityModelList gBattleEntityModelList
void set_entity_model_flags(s32 idx, s32 newFlags)
void func_80122FB8(s32 idx, s32 newFlags)
s32 is_entity_fog_enabled(void)
s32 load_entity_model(EntityModelScript *cmdList)
Gfx Gfx_RM1_SURFACE_XLU[]
void func_80122F8C(s32 idx, s32 newFlags)
Gfx Gfx_RM1_ALPHATEST_ONESIDED[]
void exec_entity_model_commandlist(s32 idx)
void draw_entity_model_E(s32 modelIdx, Mtx *transformMtx)
Gfx Gfx_RM1_SURFACE_XLU_NO_AA[]
void appendGfx_entity_model(EntityModel *model)
void free_entity_model_by_ref(EntityModel *entityModel)
void draw_entity_model_D(s32 modelIdx, Mtx *transformMtx, s32 arg2, Vec3s *vertexArray)
void draw_entity_model_A(s32 modelIdx, Mtx *transformMtx)
s32 ALT_load_entity_model(EntityModelScript *cmdList)
BSS s32 entity_fog_dist_max
void get_entity_fog_distance(s32 *start, s32 *end)
void set_entity_model_render_command_list(s32 idx, EntityModelScript *cmdList)
void draw_entity_model_B(s32 modelIdx, Mtx *transformMtx, s32 vertexSegment, Vec3s *vertexArray)
void draw_entity_model_C(s32 modelIdx, Mtx *transformMtx)
BSS s32 entity_fog_dist_min
void get_entity_fog_color(s32 *r, s32 *g, s32 *b, s32 *a)
void set_entity_fog_dist(s32 min, s32 max)
BSS s32 entity_fog_enabled
Gfx Gfx_RM1_INTERSECTING_XLU[]
Gfx Gfx_RM1_SURFACE_OPA[]
Gfx Gfx_RM3_INTERSECTING_XLU[]
Gfx Gfx_RM1_ALPHATEST_NO_ZB[]
void set_entity_fog_color(s32 r, s32 g, s32 b, s32 a)
void bind_entity_model_setupGfx(s32 idx, void *setupGfxCallbackArg0, void(*fpSetupGfxCallback)(void *))
Gfx Gfx_RM3_INTERSECTING_OPA[]
Gfx Gfx_RM1_CLOUD_NO_ZCMP[]
BSS EntityModelList gWorldEntityModelList
EntityModelScript D_8014C260
void clear_entity_models(void)
Gfx Gfx_RM1_SURFACE_OPA_NO_ZB[]
Gfx Gfx_RM1_DECAL_XLU_NO_AA[]
Gfx Gfx_RM1_PASS_THROUGH[]
Gfx Gfx_RM1_SURFACE_XLU_NO_ZB[]
void free_entity_model_by_index(s32 idx)
void disable_entity_fog(void)
Gfx Gfx_RM1_INTERSECTING_OPA[]
Gfx Gfx_RM3_SURFACE_XLU[]
@ ENTITY_MODEL_FLAG_FOG_DISABLED
@ ENTITY_MODEL_FLAG_USE_IMAGE
@ ENTITY_MODEL_FLAG_DISABLE_SCRIPT
@ ENTITY_MODEL_FLAG_10000
@ ENTITY_MODEL_FLAG_HIDDEN
@ ENTITY_MODEL_FLAG_REFLECT
@ ENTITY_MODEL_FLAG_ENABLED
@ RENDER_MODE_ALPHATEST_ONESIDED
@ RENDER_MODE_SURFACE_OPA_NO_ZB
@ RENDER_MODE_SURFACE_XLU_LAYER3
@ RENDER_MODE_DECAL_XLU_NO_AA
@ RENDER_MODE_SURFACE_XLU_LAYER2
@ RENDER_MODE_SURFACE_XLU_NO_AA
@ RENDER_MODE_INTERSECTING_XLU
@ RENDER_MODE_PASS_THROUGH
@ RENDER_MODE_SURFACE_XLU_NO_ZB
@ RENDER_MODE_SURFACE_XLU_NO_ZB_BEHIND
@ RENDER_MODE_SURFACE_OPA_NO_ZB_BEHIND
@ RENDER_MODE_DECAL_XLU_AHEAD
@ RENDER_MODE_ALPHATEST_NO_ZB_BEHIND
@ RENDER_MODE_INTERSECTING_OPA
@ RENDER_MODE_SURFACE_OPA
@ RENDER_MODE_ALPHATEST_NO_ZB
@ RENDER_MODE_SURFACE_XLU_LAYER1
@ RENDER_MODE_CLOUD_NO_ZCMP
s32 imgfx_appendGfx_component(s32, ImgFXTexture *, u32, Matrix4f)
void * heap_malloc(s32 size)
#define BATTLE_ENTITY_ID_BIT
#define MAX_ENTITY_MODELS
#define PM_CC2_MULTIPLY_SHADE
#define VIRTUAL_TO_PHYSICAL(addr)
EntityModelScript * cmdListSavedPos
void(* fpSetupGfxCallback)(void *)
union EntityModel::@46 gfx
void * setupGfxCallbackArg0
EntityModelScript * cmdListReadPos
f32 timeScale
Default is 1.0.
f32 nextFrameTime
Set to 1.0 after each update.
void(* appendGfx)(void *)
GameStatus * gGameStatusPtr
DisplayContext * gDisplayContext