From 16ddecf9594b3f094bfacfa01d35bf76824aa17d Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Sun, 4 Aug 2024 22:33:41 +0800 Subject: [PATCH] [saco] Implement/match `RpClumpAddLight(...)` --- saco/game/rwstuff.cpp | 14 ++++++++++++++ saco/game/rwstuff.h | 1 + 2 files changed, 15 insertions(+) diff --git a/saco/game/rwstuff.cpp b/saco/game/rwstuff.cpp index 7bb2ca1..35d577c 100644 --- a/saco/game/rwstuff.cpp +++ b/saco/game/rwstuff.cpp @@ -289,6 +289,20 @@ RpLight* RpLightCreate(int _type) return pLight; } +void RpClumpAddLight(RpClump *clump, RpLight *light) +{ + RpClump* pResult = NULL; + DWORD dwFunc = (iGtaVersion != GTASA_VERSION_USA10) ? 0x74A540 : 0x74A4F0; + + _asm push light + _asm push clump + _asm mov edx, dwFunc + _asm call edx + _asm pop edx + _asm pop edx + _asm mov pResult, eax +} + void RpLightSetColor(RpLight *light, RwRGBAReal *color) { DWORD dwFunc = (iGtaVersion != GTASA_VERSION_USA10) ? 0x751AE0 : 0x751A90; diff --git a/saco/game/rwstuff.h b/saco/game/rwstuff.h index 8fa4906..7088786 100644 --- a/saco/game/rwstuff.h +++ b/saco/game/rwstuff.h @@ -33,6 +33,7 @@ void RpWorldRender(); void RwCameraSetClipPlane(RwCamera *camera, float farClip, float nearClip); void RwCameraSetViewWindow(RwCamera *camera, VECTOR2D *viewWindow); RpLight* RpLightCreate(int type); +void RpClumpAddLight(RpClump *clump, RpLight *light); void RpLightSetColor(RpLight *light, RwRGBAReal *color); void RwCameraSetProjection(RwCamera *camera, int projection); void RwFrameTranslate(RwFrame *frame, VECTOR *v, int combine);