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

Go to the source code of this file.

Functions

void N gfx_build_knocked_down_player (void)
 

Function Documentation

◆ gfx_build_knocked_down_player()

void N gfx_build_knocked_down_player ( void )

Definition at line 8 of file KnockDownPlayer.inc.c.

8 {
9 KnockdownData* data = (KnockdownData*) evt_get_variable(NULL, KNOCK_DOWN_MAP_VAR);
10 ImgFXTexture ifxImg;
11 SpriteRasterInfo rasterInfo;
12 Matrix4f sp40, sp80;
13
14 gDPPipeSync(gMainGfxPos++);
15 gDPSetCycleType(gMainGfxPos++, G_CYC_1CYCLE);
16 gSPClearGeometryMode(gMainGfxPos++,
17 G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD |
18 G_SHADING_SMOOTH);
19 gSPSetGeometryMode(gMainGfxPos++, G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH);
20 gSPTexture(gMainGfxPos++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
21 gDPSetTextureLOD(gMainGfxPos++, G_TL_TILE);
22 gDPSetTexturePersp(gMainGfxPos++, G_TP_PERSP);
23 gDPSetTextureFilter(gMainGfxPos++, G_TF_BILERP);
24 gDPSetColorDither(gMainGfxPos++, G_CD_DISABLE);
25 gDPSetTextureDetail(gMainGfxPos++, G_TD_CLAMP);
26 gDPSetTextureConvert(gMainGfxPos++, G_TC_FILT);
27 gDPSetCombineKey(gMainGfxPos++, G_CK_NONE);
28 gDPSetAlphaCompare(gMainGfxPos++, G_AC_NONE);
29
30 guTranslateF(sp40, data->pos.x, data->pos.y, data->pos.z);
31 guRotateF(sp80, data->rot.y, 0.0f, 1.0f, 0.0f);
32 guMtxCatF(sp80, sp40, sp40);
33 guRotateF(sp80, data->rot.z, 0.0f, 0.0f, 1.0f);
34 guMtxCatF(sp80, sp40, sp40);
35 guRotateF(sp80, data->rot.x, 1.0f, 0.0f, 0.0f);
36 guMtxCatF(sp80, sp40, sp40);
37 guScaleF(sp80, data->scale.x, data->scale.y, data->scale.z);
38 guMtxCatF(sp80, sp40, sp40);
40 gSPMatrix(gMainGfxPos++,
41 OS_K0_TO_PHYSICAL(&gDisplayContext->matrixStack[gMatrixListPos++]),
42 G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
43
44 spr_get_player_raster_info(&rasterInfo, data->spriteIndex, data->rasterIndex);
45 ifxImg.raster = rasterInfo.raster;
46 ifxImg.palette = rasterInfo.defaultPal;
47 data->width = ifxImg.width = rasterInfo.width;
48 data->height = ifxImg.height = rasterInfo.height;
49 ifxImg.xOffset = -(s32) (rasterInfo.width * 0.5f);
50 ifxImg.yOffset = rasterInfo.height;
51 ifxImg.alpha = 255;
52
53 imgfx_appendGfx_component(data->imgfxIdx, &ifxImg, 0, sp40);
54 gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
55}
Mtx matrixStack[0x200]
f32 Matrix4f[4][4]
#define guRotateF
#define guMtxF2L
#define guTranslateF
#define guMtxCatF
#define guScaleF
s32 evt_get_variable(Evt *script, Bytecode var)
Definition evt.c:1690
s32 imgfx_appendGfx_component(s32, ImgFXTexture *, u32, Matrix4f)
Definition imgfx.c:704
void spr_get_player_raster_info(SpriteRasterInfo *out, s32 playerSpriteID, s32 rasterIndex)
Definition sprite.c:999
Gfx * gMainGfxPos
Definition cam_main.c:15
u16 gMatrixListPos
Definition main_loop.c:45
DisplayContext * gDisplayContext
Definition cam_main.c:16