summaryrefslogtreecommitdiff
path: root/mm/src/code/PreRender.c
diff options
context:
space:
mode:
authorengineer124 <47598039+engineer124@users.noreply.github.com>2024-10-17 00:13:25 +1100
committerEblo <7004497+Eblo@users.noreply.github.com>2025-09-16 10:19:17 -0400
commiteaa39054ab2cbcd2c2ea8b28acb75111b39d8c5b (patch)
tree2c14b6d782e4b808ea6b26e1e98ae894256d74cc /mm/src/code/PreRender.c
parentb9ee5bf5c7227edde85e8f0be3df0d4ac35b7fd8 (diff)
Animation Cleanup: En_V* and En_W* (#1713)
* begin anim v and w * structs * bgId * cleanup * space * more cleanup * spacing * Unsigned
Diffstat (limited to 'mm/src/code/PreRender.c')
-rw-r--r--mm/src/code/PreRender.c76
1 files changed, 38 insertions, 38 deletions
diff --git a/mm/src/code/PreRender.c b/mm/src/code/PreRender.c
index 00fddf3a8..63dae43da 100644
--- a/mm/src/code/PreRender.c
+++ b/mm/src/code/PreRender.c
@@ -58,8 +58,8 @@ void PreRender_Destroy(PreRender* this) {
ListAlloc_FreeAll(&this->alloc);
}
-void PreRender_CopyImage(PreRender* this, Gfx** gfxp, void* img, void* imgDst, u32 useThresholdAlphaCompare) {
- Gfx* gfx = *gfxp;
+void PreRender_CopyImage(PreRender* this, Gfx** gfxP, void* img, void* imgDst, u32 useThresholdAlphaCompare) {
+ Gfx* gfx = *gfxP;
u32 flags;
gDPPipeSync(gfx++);
@@ -76,15 +76,15 @@ void PreRender_CopyImage(PreRender* this, Gfx** gfxp, void* img, void* imgDst, u
gDPPipeSync(gfx++);
gDPSetColorImage(gfx++, G_IM_FMT_RGBA, G_IM_SIZ_16b, this->width, this->fbuf);
- *gfxp = gfx;
+ *gfxP = gfx;
}
-void PreRender_RestoreBuffer(PreRender* this, Gfx** gfxp, void* buf, void* bufSave) {
- PreRender_CopyImage(this, gfxp, buf, bufSave, false);
+void PreRender_RestoreBuffer(PreRender* this, Gfx** gfxP, void* buf, void* bufSave) {
+ PreRender_CopyImage(this, gfxP, buf, bufSave, false);
}
-void func_8016FF90(PreRender* this, Gfx** gfxp, void* buf, void* bufSave, s32 envR, s32 envG, s32 envB, s32 envA) {
- Gfx* gfx = *gfxp;
+void func_8016FF90(PreRender* this, Gfx** gfxP, void* buf, void* bufSave, s32 envR, s32 envG, s32 envB, s32 envA) {
+ Gfx* gfx = *gfxP;
gDPPipeSync(gfx++);
@@ -112,25 +112,25 @@ void func_8016FF90(PreRender* this, Gfx** gfxp, void* buf, void* bufSave, s32 en
gDPPipeSync(gfx++);
gDPSetColorImage(gfx++, G_IM_FMT_RGBA, G_IM_SIZ_16b, this->width, this->fbuf);
- *gfxp = gfx;
+ *gfxP = gfx;
}
-void func_80170200(PreRender* this, Gfx** gfxp, void* buf, void* bufSave) {
- func_8016FF90(this, gfxp, buf, bufSave, 255, 255, 255, 255);
+void func_80170200(PreRender* this, Gfx** gfxP, void* buf, void* bufSave) {
+ func_8016FF90(this, gfxP, buf, bufSave, 255, 255, 255, 255);
}
/**
* Reads the coverage values stored in the RGBA16 format `img` with dimensions `this->width`, `this->height` and
* converts it to an 8-bpp intensity image.
*
- * @param gfxp Display list pointer
+ * @param gfxP Display list pointer
* @param img Image to read coverage from
* @param cvgDst Buffer to store coverage into
*/
-void PreRender_CoverageRgba16ToI8(PreRender* this, Gfx** gfxp, void* img, void* cvgDst) {
+void PreRender_CoverageRgba16ToI8(PreRender* this, Gfx** gfxP, void* img, void* cvgDst) {
// BENTODO:
return;
- Gfx* gfx = *gfxp;
+ Gfx* gfx = *gfxP;
s32 rowsRemaining;
s32 curRow;
s32 nRows;
@@ -203,24 +203,24 @@ void PreRender_CoverageRgba16ToI8(PreRender* this, Gfx** gfxp, void* img, void*
gDPPipeSync(gfx++);
gDPSetColorImage(gfx++, G_IM_FMT_RGBA, G_IM_SIZ_16b, this->width, this->fbuf);
- *gfxp = gfx;
+ *gfxP = gfx;
}
/**
* Saves zbuf to zbufSave
*/
-void PreRender_SaveZBuffer(PreRender* this, Gfx** gfxp) {
+void PreRender_SaveZBuffer(PreRender* this, Gfx** gfxP) {
if ((this->zbufSave != NULL) && (this->zbuf != NULL)) {
- PreRender_RestoreBuffer(this, gfxp, this->zbuf, this->zbufSave);
+ PreRender_RestoreBuffer(this, gfxP, this->zbuf, this->zbufSave);
}
}
/**
* Saves fbuf to fbufSave
*/
-void PreRender_SaveFramebuffer(PreRender* this, Gfx** gfxp) {
+void PreRender_SaveFramebuffer(PreRender* this, Gfx** gfxP) {
if ((this->fbufSave != NULL) && (this->fbuf != NULL)) {
- func_80170200(this, gfxp, this->fbuf, this->fbufSave);
+ func_80170200(this, gfxP, this->fbuf, this->fbufSave);
}
}
@@ -228,8 +228,8 @@ void PreRender_SaveFramebuffer(PreRender* this, Gfx** gfxp) {
* Fetches the coverage of the current framebuffer into an image of the same format as the current color image, storing
* it over the framebuffer in memory.
*/
-void PreRender_FetchFbufCoverage(PreRender* this, Gfx** gfxp) {
- Gfx* gfx = *gfxp;
+void PreRender_FetchFbufCoverage(PreRender* this, Gfx** gfxP) {
+ Gfx* gfx = *gfxP;
gDPPipeSync(gfx++);
// Set the blend color to full white and set maximum depth
@@ -258,33 +258,33 @@ void PreRender_FetchFbufCoverage(PreRender* this, Gfx** gfxp) {
gDPFillRectangle(gfx++, 0, 0, this->width, this->height);
gDPPipeSync(gfx++);
- *gfxp = gfx;
+ *gfxP = gfx;
}
/**
* Draws the coverage of the current framebuffer `this->fbuf` to an I8 image at `this->cvgSave`. Overwrites
* `this->fbuf` in the process.
*/
-void PreRender_DrawCoverage(PreRender* this, Gfx** gfxp) {
- PreRender_FetchFbufCoverage(this, gfxp);
+void PreRender_DrawCoverage(PreRender* this, Gfx** gfxP) {
+ PreRender_FetchFbufCoverage(this, gfxP);
if (this->cvgSave != NULL) {
- PreRender_CoverageRgba16ToI8(this, gfxp, this->fbuf, this->cvgSave);
+ PreRender_CoverageRgba16ToI8(this, gfxP, this->fbuf, this->cvgSave);
}
}
/**
* Restores zbufSave to zbuf
*/
-void PreRender_RestoreZBuffer(PreRender* this, Gfx** gfxp) {
- PreRender_RestoreBuffer(this, gfxp, this->zbufSave, this->zbuf);
+void PreRender_RestoreZBuffer(PreRender* this, Gfx** gfxP) {
+ PreRender_RestoreBuffer(this, gfxP, this->zbufSave, this->zbuf);
}
/**
* Draws a full-screen image to the current framebuffer, that sources the rgb channel from `this->fbufSave` and
* the alpha channel from `this->cvgSave` modulated by environment color.
*/
-void func_80170798(PreRender* this, Gfx** gfxp) {
+void func_80170798(PreRender* this, Gfx** gfxP) {
Gfx* gfx;
s32 rowsRemaining;
s32 curRow;
@@ -292,7 +292,7 @@ void func_80170798(PreRender* this, Gfx** gfxp) {
s32 rtile = 1;
if (this->cvgSave != NULL) {
- gfx = *gfxp;
+ gfx = *gfxP;
gDPPipeSync(gfx++);
gDPSetEnvColor(gfx++, 255, 255, 255, 32);
@@ -348,19 +348,19 @@ void func_80170798(PreRender* this, Gfx** gfxp) {
}
gDPPipeSync(gfx++);
- *gfxp = gfx;
+ *gfxP = gfx;
}
}
-void func_80170AE0(PreRender* this, Gfx** gfxp, s32 alpha) {
- func_8016FF90(this, gfxp, this->fbufSave, this->fbuf, 255, 255, 255, alpha);
+void func_80170AE0(PreRender* this, Gfx** gfxP, s32 alpha) {
+ func_8016FF90(this, gfxP, this->fbufSave, this->fbuf, 255, 255, 255, alpha);
}
/**
* Copies fbufSave to fbuf
*/
-void PreRender_RestoreFramebuffer(PreRender* this, Gfx** gfxp) {
- PreRender_RestoreBuffer(this, gfxp, this->fbufSave, this->fbuf);
+void PreRender_RestoreFramebuffer(PreRender* this, Gfx** gfxP) {
+ PreRender_RestoreBuffer(this, gfxP, this->fbufSave, this->fbuf);
}
/**
@@ -761,7 +761,7 @@ typedef struct {
/* 0x24 */ u32 flags;
} PreRenderBackground2DParams; // size = 0x28
-void Prerender_DrawBackground2DImpl(PreRenderBackground2DParams* bg2D, Gfx** gfxp) {
+void Prerender_DrawBackground2DImpl(PreRenderBackground2DParams* bg2D, Gfx** gfxP) {
Gfx* gfx;
uObjBg* bg;
u32 alphaCompare;
@@ -771,7 +771,7 @@ void Prerender_DrawBackground2DImpl(PreRenderBackground2DParams* bg2D, Gfx** gfx
loadS2DEX2 = (bg2D->flags & BG2D_FLAGS_LOAD_S2DEX2) != 0;
alphaCompare = (bg2D->flags & BG2D_FLAGS_AC_THRESHOLD) ? G_AC_THRESHOLD : G_AC_NONE;
- gfxTemp = *gfxp;
+ gfxTemp = *gfxP;
bg = Graph_DlistAlloc(&gfxTemp, sizeof(uObjBg));
gfx = gfxTemp;
@@ -839,10 +839,10 @@ void Prerender_DrawBackground2DImpl(PreRenderBackground2DParams* bg2D, Gfx** gfx
gSPLoadUcode(gfx++, SysUcode_GetUCode());
}
- *gfxp = gfx;
+ *gfxP = gfx;
}
-void Prerender_DrawBackground2D(Gfx** gfxp, void* timg, void* tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 tt,
+void Prerender_DrawBackground2D(Gfx** gfxP, void* timg, void* tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 tt,
u16 tlutCount, f32 x, f32 y, f32 xScale, f32 yScale, u32 flags) {
PreRenderBackground2DParams bg2D;
PreRenderBackground2DParams* bg2DPtr = &bg2D;
@@ -861,5 +861,5 @@ void Prerender_DrawBackground2D(Gfx** gfxp, void* timg, void* tlut, u16 width, u
bg2D.yScale = yScale;
bg2D.flags = flags;
- Prerender_DrawBackground2DImpl(bg2DPtr, gfxp);
+ Prerender_DrawBackground2DImpl(bg2DPtr, gfxP);
}