Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
ArrowSign.c
Go to the documentation of this file.
1#include "common.h"
2#include "entity.h"
3#include "ld_addrs.h"
4
5extern Gfx Entity_ArrowSign_Render[];
8
9void entity_ArrowSign_setupGfx(s32 entityIndex) {
10 Gfx* gfxPos = gMainGfxPos;
11 Entity* entity = get_entity_by_index(entityIndex);
12 ArrowSignData* data = entity->dataBuf.arrowSign;
13 Matrix4f sp18;
14 Matrix4f sp58;
15 Gfx* gfx;
16
17 guMtxL2F(sp18, ENTITY_ADDR(entity, Mtx*, &Entity_ArrowSign_mtxSign));
18 guRotateF(sp58, clamp_angle(data->angle - 90.0f), 0.0f, 0.0f, 1.0f);
19 guMtxCatF(sp58, sp18, sp18);
21
22 gSPMatrix(gfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], G_MTX_PUSH | G_MTX_MUL | G_MTX_MODELVIEW);
24 gSPDisplayList(gfxPos++, gfx);
25 gSPPopMatrix(gfxPos++, G_MTX_MODELVIEW);
26 gMainGfxPos = gfxPos;
27}
28
30}
31
33 f32 angle = CreateEntityVarArgBuffer[0];
34 ArrowSignData* data = entity->dataBuf.arrowSign;
35
36 data->angle = angle;
37 data->unk_08 = angle;
39}
40
47
52
54
57 .typeDataSize = sizeof(ArrowSignData),
58 .renderCommandList = Entity_ArrowSign_RenderScript,
59 .modelAnimationNodes = 0,
60 .fpInit = entity_ArrowSign_init,
61 .updateEntityScript = Entity_ArrowSign_Script,
62 .fpHandleCollision = entity_ArrowSign_handle_collision,
63 { .dma = ENTITY_ROM(ArrowSign) },
64 .entityType = ENTITY_TYPE_RED_ARROW_SIGNS,
65 .aabbSize = { 18, 50, 10 }
66};
Mtx matrixStack[0x200]
f32 Matrix4f[4][4]
struct ArrowSignData * arrowSign
#define guRotateF
#define guMtxF2L
#define guMtxCatF
#define clamp_angle
s32 CreateEntityVarArgBuffer[]
Definition entity.c:35
s32 EntityModelScript[]
Definition entity.h:7
#define STANDARD_ENTITY_MODEL_SCRIPT(gfx, renderMode)
Definition entity.h:56
#define ENTITY_ADDR(entity, type, data)
Definition entity.h:64
#define es_SetCallback(func, time)
Definition entity.h:38
#define ENTITY_ROM(name)
Definition entity.h:65
s32 EntityScript[]
Definition entity.h:6
#define es_End
Definition entity.h:35
@ ENTITY_TYPE_RED_ARROW_SIGNS
Definition enums.h:2589
@ PA_FLAG_USING_WATT
Definition enums.h:3090
@ ENTITY_COLLISION_PLAYER_TOUCH_WALL
Definition enums.h:2651
@ RENDER_MODE_SURFACE_OPA
Definition enums.h:3264
@ ENTITY_FLAG_400
Definition enums.h:2623
@ ENTITY_FLAG_FIXED_SHADOW_SIZE
Definition enums.h:2622
@ ENTITY_FLAG_CIRCULAR_SHADOW
Definition enums.h:2624
Entity * get_entity_by_index(s32 index)
Definition entity.c:530
s32 entity_start_script(Entity *entity)
Definition entity.c:560
EntityScript Entity_ArrowSign_Script
Definition ArrowSign.c:48
void entity_ArrowSign_init(Entity *entity)
Definition ArrowSign.c:32
Gfx Entity_ArrowSign_RenderRotatedSign[]
Definition ArrowSign.c:57
EntityModelScript Entity_ArrowSign_RenderScript
Definition ArrowSign.c:53
void entity_ArrowSign_setupGfx(s32 entityIndex)
Definition ArrowSign.c:9
s32 entity_ArrowSign_handle_collision(Entity *entity)
Definition ArrowSign.c:41
void entity_ArrowSign_idle(void)
Definition ArrowSign.c:29
EntityBlueprint Entity_ArrowSign
Definition ArrowSign.c:55
Mtx Entity_ArrowSign_mtxSign
Definition ArrowSign.c:32
Gfx Entity_ArrowSign_Render[]
Definition ArrowSign.c:81
void(* renderSetupFunc)(s32)
EntityData dataBuf
u8 collisionFlags
Gfx * gMainGfxPos
Definition cam_main.c:15
u16 gMatrixListPos
Definition main_loop.c:45
PlayerStatus gPlayerStatus
Definition 77480.c:39
DisplayContext * gDisplayContext
Definition cam_main.c:16