M3d_RenderCleanup

This commit is contained in:
krystalgamer 2024-09-19 17:20:42 +02:00
parent 095327a1f3
commit 3d19d640e1
4 changed files with 66 additions and 3 deletions

View File

@ -5,8 +5,8 @@
u32 M3d_FadeColour;
EXPORT i16 WibbleTables[1024];
EXPORT u32 Xres;
EXPORT u32 Yres;
u32 Xres;
u32 Yres;
EXPORT i32 PixelAspectX;
EXPORT i32 PixelAspectY;

View File

@ -6,6 +6,8 @@
#include "export.h"
EXPORT extern u32 M3d_FadeColour;
EXPORT extern u32 Xres;
EXPORT extern u32 Yres;
union ItemOffsetUnion
{

View File

@ -1,7 +1,13 @@
#include "ps2m3d.h"
#include "ps2funcs.h"
#include "db.h"
#include "PCGfx.h"
#include "m3dinit.h"
#include "SpideyDX.h"
i32 gWideScreen;
// @FIXME
char gRenderBuf[4] = { 0, 0, 0, 0 };
// @SMALLTODO
void M3d_BuildTransform(CSuper* a)
@ -45,10 +51,64 @@ void M3d_RenderBackground(void *)
printf("M3d_RenderBackground(void *)");
}
// @MEDIUMTODO
// @Ok
// @Test
// can't get it to match but that's fine, looks good tho
void M3d_RenderCleanup(void)
{
SetDrawArea();
gDbRelated += 12;
stubbed_printf(gRenderBuf);
if (gWideScreen)
{
PCGfx_UseTexture(1, DCGfx_BlendingMode_0);
float v2 = (float)gGameResolutionY;
float v5 = (float)(unsigned int)Yres;
float v1 = v2 / v5;
float v6 = (float)gWideScreen;
float v12 = v1 * v6;
float v7 = (float)gGameResolutionX;
float v3 = (float)(unsigned int)Xres;
float v8 = v7 / v3 * 512.0f;
PCGfx_DrawQuad2D(
0,
0,
v8,
v12,
0,
0,
1.0,
1.0,
0xFF000000,
0.0,
false);
float v13 = (float)gGameResolutionY;
float v9 = (float)(unsigned int)Yres;
float v4 = v13 / v9;
float v14 = (float)gWideScreen;
float v18 = v14 * v4;
float v15 = (float)gGameResolutionX;
float v10 = (float)(unsigned int)Xres;
float v11 = v15 / v10 * 512.0f;
float v16 = (float)(240 - gWideScreen);
float v17 = v16 * v4;
PCGfx_DrawQuad2D(
0,
v17,
v11,
v18,
0,
0,
1.0,
1.0,
0xFF000000,
0.0,
false);
}
}
// @MEDIUMTODO

View File

@ -22,5 +22,6 @@ EXPORT void M3d_RenderSetup(SCamera *,SViewport *,u32 *);
EXPORT void RenderSuperItem(CItem *,bool);
EXPORT extern i32 gWideScreen;
EXPORT extern char gRenderBuf[4];
#endif