From 919199284d3a51c1e3e34f79d65f34bdd0827034 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Sun, 4 Aug 2024 22:28:46 +0800 Subject: [PATCH] [saco] Implement/match `RwCameraClear(...)` --- saco/game/rwstuff.cpp | 14 ++++++++++++++ saco/game/rwstuff.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/saco/game/rwstuff.cpp b/saco/game/rwstuff.cpp index e618ff5..5544d0c 100644 --- a/saco/game/rwstuff.cpp +++ b/saco/game/rwstuff.cpp @@ -128,6 +128,20 @@ void RpWorldAddCamera(RwCamera *camera) _asm pop edx } +void RwCameraClear(RwCamera *camera, RwRGBA *color, int clearMode) +{ + DWORD dwFunc = (iGtaVersion != GTASA_VERSION_USA10) ? 0x7EE380 : 0x7EE340; + + _asm push clearMode + _asm push color + _asm push camera + _asm mov edx, dwFunc + _asm call edx + _asm pop edx + _asm pop edx + _asm pop edx +} + void RwObjectHasFrameSetFrame(RwCamera *camera, RwFrame *frame) { DWORD dwFunc = (iGtaVersion != GTASA_VERSION_USA10) ? 0x804F30 : 0x804EF0l; diff --git a/saco/game/rwstuff.h b/saco/game/rwstuff.h index 0592630..2c289a9 100644 --- a/saco/game/rwstuff.h +++ b/saco/game/rwstuff.h @@ -8,6 +8,7 @@ struct RwCamera { char _gap0; }; struct RpLight { char _gap0; }; struct RwRGBAReal { float r, g, b, a; }; struct RpAtomic { char _gap0; }; +struct RwRGBA { char _gap0; }; RwRaster* RwRasterCreate(int width, int height, int depth, int flags); RwTexture* RwTextureCreate(RwRaster *raster); @@ -19,6 +20,7 @@ RwCamera* RwCameraCreate(); void RwRasterDestroy(RwRaster *raster); void CShadowCamera_Create(int iRasterSize); void RpWorldAddCamera(RwCamera *camera); +void RwCameraClear(RwCamera *camera, RwRGBA *color, int clearMode); void RwObjectHasFrameSetFrame(RwCamera *camera, RwFrame *frame); void SetCameraFrameAndZBuffer(RwCamera *camera, RwRaster *frameBuffer, RwRaster *zBuffer); void RwCameraSetClipPlane(RwCamera *camera, float farClip, float nearClip);