diff options
author | Roman Masanin <36927roma@gmail.com> | 2020-10-12 12:42:57 +0200 |
---|---|---|
committer | Roman Masanin <36927roma@gmail.com> | 2020-10-12 12:42:57 +0200 |
commit | 417646819c5d88bb7774bbb0341d92ada3293196 (patch) | |
tree | 4da51aa3be7f75002b16985207d9411d900dde7d /src/entities | |
parent | mark file and fix screen offset (diff) | |
parent | Merge pull request #753 from majesticCoding/miami (diff) | |
download | re3-417646819c5d88bb7774bbb0341d92ada3293196.tar re3-417646819c5d88bb7774bbb0341d92ada3293196.tar.gz re3-417646819c5d88bb7774bbb0341d92ada3293196.tar.bz2 re3-417646819c5d88bb7774bbb0341d92ada3293196.tar.lz re3-417646819c5d88bb7774bbb0341d92ada3293196.tar.xz re3-417646819c5d88bb7774bbb0341d92ada3293196.tar.zst re3-417646819c5d88bb7774bbb0341d92ada3293196.zip |
Diffstat (limited to 'src/entities')
-rw-r--r-- | src/entities/Dummy.cpp | 2 | ||||
-rw-r--r-- | src/entities/Entity.cpp | 33 | ||||
-rw-r--r-- | src/entities/Entity.h | 1 |
3 files changed, 36 insertions, 0 deletions
diff --git a/src/entities/Dummy.cpp b/src/entities/Dummy.cpp index 92b69761..544e24a6 100644 --- a/src/entities/Dummy.cpp +++ b/src/entities/Dummy.cpp @@ -4,6 +4,8 @@ #include "World.h" #include "Dummy.h" +// --MIAMI: file done + void *CDummy::operator new(size_t sz) { return CPools::GetDummyPool()->New(); } void CDummy::operator delete(void *p, size_t sz) { CPools::GetDummyPool()->Delete((CDummy*)p); } diff --git a/src/entities/Entity.cpp b/src/entities/Entity.cpp index cf1dd9e7..2285c93f 100644 --- a/src/entities/Entity.cpp +++ b/src/entities/Entity.cpp @@ -1207,4 +1207,37 @@ bool CEntity::IsEntityOccluded(void) { } return false; +} + +/* +0x487A10 - SetAtomicAlphaCB +0x4879E0 - SetClumpAlphaCB +*/ + +RpMaterial* SetAtomicAlphaCB(RpMaterial *material, void *data) { + ((RwRGBA*)RpMaterialGetColor(material))->alpha = (uint8)(uintptr)data; + return material; +} + +RpAtomic* SetClumpAlphaCB(RpAtomic *atomic, void *data) { + RpGeometry *geometry = RpAtomicGetGeometry(atomic); + RpGeometrySetFlags(geometry, RpGeometryGetFlags(geometry) | rpGEOMETRYMODULATEMATERIALCOLOR); + RpGeometryForAllMaterials(geometry, SetAtomicAlphaCB, (void*)data); + return atomic; +} + +void CEntity::SetRwObjectAlpha(int32 alpha) { + if (m_rwObject != nil) { + switch (RwObjectGetType(m_rwObject)) { + case rpATOMIC: { + RpGeometry *geometry = RpAtomicGetGeometry((RpAtomic*)m_rwObject); + RpGeometrySetFlags(geometry, RpGeometryGetFlags(geometry) | rpGEOMETRYMODULATEMATERIALCOLOR); + RpGeometryForAllMaterials(geometry, SetAtomicAlphaCB, (void*)alpha); + break; + } + case rpCLUMP: + RpClumpForAllAtomics((RpClump*)m_rwObject, SetClumpAlphaCB, (void*)alpha); + break; + } + } }
\ No newline at end of file diff --git a/src/entities/Entity.h b/src/entities/Entity.h index fd01b6f8..fbf5cb3b 100644 --- a/src/entities/Entity.h +++ b/src/entities/Entity.h @@ -179,6 +179,7 @@ public: void ModifyMatrixForTreeInWind(void); void ModifyMatrixForBannerInWind(void); void ProcessLightsForEntity(void); + void SetRwObjectAlpha(int32 alpha); static void AddSteamsFromGround(CPtrList& list); }; |