Paper Mario DX
Paper Mario (N64) modding
Loading...
Searching...
No Matches
Shadow.c
Go to the documentation of this file.
1
#include "common.h"
2
#include "
entity.h
"
3
#include "
include_asset.h
"
4
5
void
entity_Shadow_init
(
Shadow
* shadow) {
6
shadow->
scale
.
x
= 0.1f;
7
shadow->
scale
.
y
= 0.1f;
8
shadow->
scale
.
z
= 0.1f;
9
}
10
11
s32
entity_can_collide_with_jumping_player
(
Entity
* entity) {
12
if
((entity->
collisionFlags
&
ENTITY_COLLISION_PLAYER_TOUCH_CEILING
)
13
&& (
gPlayerStatus
.
flags
&
PS_FLAG_JUMPING
)
14
) {
15
return
TRUE;
16
}
17
return
FALSE;
18
}
19
20
INCLUDE_IMG
(
"entity/shadow/square.png"
, D_802E9170);
21
INCLUDE_IMG
(
"entity/shadow/circle.png"
, D_802E91F0);
22
#include "entity/vtx/shadow1.vtx.inc.c"
23
#include "entity/vtx/shadow2.vtx.inc.c"
24
INCLUDE_IMG
(
"entity/shadow/square_big.png"
, D_802E92F0);
25
INCLUDE_IMG
(
"entity/shadow/circle_big.png"
, D_802E94F0);
26
27
Gfx
Entity_Shadow_GfxCommon
[] = {
28
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
29
gsDPPipeSync(),
30
gsDPSetTexturePersp(G_TP_PERSP),
31
gsDPSetTextureDetail(G_TD_CLAMP),
32
gsDPSetTextureLOD(G_TL_TILE),
33
gsDPSetTextureLUT(G_TT_NONE),
34
gsDPSetTextureFilter(G_TF_BILERP),
35
gsDPSetTextureConvert(G_TC_FILT),
36
gsSPEndDisplayList(),
37
};
38
39
Gfx
Entity_Shadow_LoadTexSquare
[] = {
40
gsSPDisplayList(
Entity_Shadow_GfxCommon
),
41
gsDPSetTextureLUT(G_TT_NONE),
42
gsDPLoadTextureTile_4b(D_802E9170, G_IM_FMT_I, 16, 16, 0, 0, 15, 15, 0, G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 4, 4, G_TX_NOLOD, G_TX_NOLOD),
43
gsSPEndDisplayList(),
44
};
45
46
Gfx
Entity_Shadow_LoadTexCircle
[] = {
47
gsSPDisplayList(
Entity_Shadow_GfxCommon
),
48
gsDPSetTextureLUT(G_TT_NONE),
49
gsDPLoadTextureTile_4b(D_802E91F0, G_IM_FMT_I, 16, 16, 0, 0, 15, 15, 0, G_TX_MIRROR | G_TX_WRAP, G_TX_MIRROR | G_TX_WRAP, 4, 4, G_TX_NOLOD, G_TX_NOLOD),
50
gsSPEndDisplayList(),
51
};
52
53
Gfx
Entity_RenderSquareShadow
[] = {
54
gsSPDisplayList(
Entity_Shadow_LoadTexSquare
),
55
gsSPClearGeometryMode(G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
56
gsSPVertex(D_802E92B0, 4, 0),
57
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
58
gsSPEndDisplayList(),
59
};
60
61
Gfx
Entity_RenderCircularShadow
[] = {
62
gsSPDisplayList(
Entity_Shadow_LoadTexCircle
),
63
gsSPClearGeometryMode(G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
64
gsSPVertex(D_802E9270, 4, 0),
65
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
66
gsSPEndDisplayList(),
67
};
68
69
Gfx
Entity_RenderNone
[] = {
70
gsSPEndDisplayList(),
71
};
72
73
EntityModelScript
Entity_RenderNone_Script
= {
74
ems_Draw
(
Entity_RenderNone
, 60)
75
ems_Restart
76
ems_End
77
};
78
79
//TODO split files
80
s32
D_802E9844_padding
[] = { 0, 0, 0};
81
82
EntityModelScript
Entity_CircularShadowA_Render
= {
83
ems_SetFlags
(
ENTITY_MODEL_FLAG_FOG_DISABLED
)
84
ems_SetRenderMode
(
RENDER_MODE_SHADOW
)
85
ems_Draw
(
Entity_RenderCircularShadow
, 60)
86
ems_Restart
87
ems_End
88
};
89
90
EntityModelScript
Entity_CircularShadowB_Render
= {
91
ems_SetFlags
(
ENTITY_MODEL_FLAG_FOG_DISABLED
)
92
ems_SetRenderMode
(
RENDER_MODE_SHADOW
)
93
ems_Draw
(
Entity_RenderCircularShadow
, 60)
94
ems_Restart
95
ems_End
96
};
97
98
EntityModelScript
Entity_SquareShadow_Render
= {
99
ems_SetFlags
(
ENTITY_MODEL_FLAG_FOG_DISABLED
)
100
ems_SetRenderMode
(
RENDER_MODE_SHADOW
)
101
ems_Draw
(
Entity_RenderSquareShadow
, 60)
102
ems_Restart
103
ems_End
104
};
105
106
ShadowBlueprint
CircularShadowA
= {
107
.
flags
=
ENTITY_FLAG_DISABLE_COLLISION
,
108
.renderCommandList =
Entity_CircularShadowA_Render
,
109
.animModelNode = NULL,
110
.onCreateCallback =
entity_Shadow_init
,
111
.entityType =
ENTITY_TYPE_SHADOW
,
112
.aabbSize = { 25, 10, 25 }
113
};
114
115
ShadowBlueprint
CircularShadowB
= {
116
.
flags
=
ENTITY_FLAG_DISABLE_COLLISION
,
117
.renderCommandList =
Entity_CircularShadowB_Render
,
118
.animModelNode = NULL,
119
.onCreateCallback =
entity_Shadow_init
,
120
.entityType =
ENTITY_TYPE_SHADOW
,
121
.aabbSize = { 25, 10, 25 }
122
};
123
124
ShadowBlueprint
SquareShadow
= {
125
.
flags
=
ENTITY_FLAG_DISABLE_COLLISION
,
126
.renderCommandList =
Entity_SquareShadow_Render
,
127
.animModelNode = NULL,
128
.onCreateCallback =
entity_Shadow_init
,
129
.entityType =
ENTITY_TYPE_SHADOW
,
130
.aabbSize = { 25, 10, 25 }
131
};
Entity_RenderNone_Script
EntityModelScript Entity_RenderNone_Script
Definition
Shadow.c:73
Entity_SquareShadow_Render
EntityModelScript Entity_SquareShadow_Render
Definition
Shadow.c:98
Entity_RenderCircularShadow
Gfx Entity_RenderCircularShadow[]
Definition
Shadow.c:61
entity_Shadow_init
void entity_Shadow_init(Shadow *shadow)
Definition
Shadow.c:5
entity_can_collide_with_jumping_player
s32 entity_can_collide_with_jumping_player(Entity *entity)
Definition
Shadow.c:11
Entity_RenderSquareShadow
Gfx Entity_RenderSquareShadow[]
Definition
Shadow.c:53
SquareShadow
ShadowBlueprint SquareShadow
Definition
Shadow.c:124
CircularShadowB
ShadowBlueprint CircularShadowB
Definition
Shadow.c:115
Entity_Shadow_LoadTexSquare
Gfx Entity_Shadow_LoadTexSquare[]
Definition
Shadow.c:39
Entity_Shadow_LoadTexCircle
Gfx Entity_Shadow_LoadTexCircle[]
Definition
Shadow.c:46
Entity_RenderNone
Gfx Entity_RenderNone[]
Definition
Shadow.c:69
Entity_CircularShadowA_Render
EntityModelScript Entity_CircularShadowA_Render
Definition
Shadow.c:82
CircularShadowA
ShadowBlueprint CircularShadowA
Definition
Shadow.c:106
D_802E9844_padding
s32 D_802E9844_padding[]
Definition
Shadow.c:80
Entity_Shadow_GfxCommon
Gfx Entity_Shadow_GfxCommon[]
Definition
Shadow.c:27
Entity_CircularShadowB_Render
EntityModelScript Entity_CircularShadowB_Render
Definition
Shadow.c:90
Vec3f::z
f32 z
Definition
common_structs.h:102
Shadow::scale
Vec3f scale
Definition
common_structs.h:612
PlayerStatus::flags
s32 flags
Definition
common_structs.h:1980
Vec3f::x
f32 x
Definition
common_structs.h:100
Vec3f::y
f32 y
Definition
common_structs.h:101
Shadow
Definition
common_structs.h:602
entity.h
EntityModelScript
s32 EntityModelScript[]
Definition
entity.h:7
ems_Restart
#define ems_Restart
Definition
entity.h:49
ems_SetRenderMode
#define ems_SetRenderMode(mode)
Definition
entity.h:51
ems_SetFlags
#define ems_SetFlags(flags)
Definition
entity.h:52
ems_End
#define ems_End
Definition
entity.h:47
ems_Draw
#define ems_Draw(dlist, holdTime)
Definition
entity.h:48
ENTITY_MODEL_FLAG_FOG_DISABLED
@ ENTITY_MODEL_FLAG_FOG_DISABLED
Definition
enums.h:5021
PS_FLAG_JUMPING
@ PS_FLAG_JUMPING
Definition
enums.h:3035
ENTITY_TYPE_SHADOW
@ ENTITY_TYPE_SHADOW
Definition
enums.h:2544
ENTITY_COLLISION_PLAYER_TOUCH_CEILING
@ ENTITY_COLLISION_PLAYER_TOUCH_CEILING
Definition
enums.h:2650
RENDER_MODE_SHADOW
@ RENDER_MODE_SHADOW
Definition
enums.h:3297
ENTITY_FLAG_DISABLE_COLLISION
@ ENTITY_FLAG_DISABLE_COLLISION
Definition
enums.h:2618
include_asset.h
INCLUDE_IMG
#define INCLUDE_IMG(FILENAME, SYMBOLNAME)
Definition
include_asset.h:27
Entity
Definition
common_structs.h:550
Entity::collisionFlags
u8 collisionFlags
Definition
common_structs.h:554
ShadowBlueprint
Definition
common_structs.h:591
ShadowBlueprint::flags
u16 flags
Definition
common_structs.h:592
gPlayerStatus
PlayerStatus gPlayerStatus
Definition
77480.c:39
src
entity
Shadow.c
Generated by
1.10.0