diff options
author | erorcun <erayorcunus@gmail.com> | 2020-10-12 11:37:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-12 11:37:47 +0200 |
commit | 96f36d16aebe87f664b2c9487ba7f9f3edd27d39 (patch) | |
tree | dd64811c90f08b1beb8d78d37d758aea50db2079 /src/entities/Entity.cpp | |
parent | Fix forgotten wanted/busted text (diff) | |
parent | CWaterCreatures (diff) | |
download | re3-96f36d16aebe87f664b2c9487ba7f9f3edd27d39.tar re3-96f36d16aebe87f664b2c9487ba7f9f3edd27d39.tar.gz re3-96f36d16aebe87f664b2c9487ba7f9f3edd27d39.tar.bz2 re3-96f36d16aebe87f664b2c9487ba7f9f3edd27d39.tar.lz re3-96f36d16aebe87f664b2c9487ba7f9f3edd27d39.tar.xz re3-96f36d16aebe87f664b2c9487ba7f9f3edd27d39.tar.zst re3-96f36d16aebe87f664b2c9487ba7f9f3edd27d39.zip |
Diffstat (limited to 'src/entities/Entity.cpp')
-rw-r--r-- | src/entities/Entity.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
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 |