From a378f20823cc41024836576e697c15c30e80bc6d Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Tue, 30 Jul 2024 23:06:46 +0800 Subject: [PATCH] [saco] Implement/match `RwTextureDestroy(...)` --- saco/game/rwstuff.cpp | 10 ++++++++++ saco/game/rwstuff.h | 1 + 2 files changed, 11 insertions(+) diff --git a/saco/game/rwstuff.cpp b/saco/game/rwstuff.cpp index bc50818..b652601 100644 --- a/saco/game/rwstuff.cpp +++ b/saco/game/rwstuff.cpp @@ -40,6 +40,16 @@ RwTexture* RwTextureCreate(RwRaster *raster) return pTexture; } +void RwTextureDestroy(RwTexture *texture) +{ + DWORD dwFunc = (iGtaVersion != GTASA_VERSION_USA10) ? 0x7F3860 : 0x7F3820; + + _asm push texture + _asm mov edx, dwFunc + _asm call edx + _asm pop edx +} + RwFrame* RwFrameCreate() { RwFrame* pFrame = NULL; diff --git a/saco/game/rwstuff.h b/saco/game/rwstuff.h index 9c5c19e..25e8407 100644 --- a/saco/game/rwstuff.h +++ b/saco/game/rwstuff.h @@ -10,6 +10,7 @@ struct RwRGBAReal { float r, g, b, a; }; RwRaster* RwRasterCreate(int width, int height, int depth, int flags); RwTexture* RwTextureCreate(RwRaster *raster); +void RwTextureDestroy(RwTexture *texture); RwFrame* RwFrameCreate(); RwCamera* RwCameraCreate(); void RpWorldAddCamera(RwCamera *camera);