mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2024-12-28 23:03:01 +05:00
SetComponentRotation moved to code
This commit is contained in:
parent
9b75302ba5
commit
6006e253b1
3 changed files with 29 additions and 4 deletions
|
@ -243,6 +243,9 @@ RwBool _rpD3D9VertexDeclarationInstColor(RwUInt8* mem, const RwRGBA* color, RwIn
|
|||
return alpha != 255;
|
||||
}
|
||||
|
||||
// Unreachable stub
|
||||
RwBool RwMatrixDestroy(RwMatrix* mpMat) { assert(!"Unreachable!"); return TRUE; }
|
||||
|
||||
struct AlphaObjectInfo
|
||||
{
|
||||
RpAtomic* pAtomic;
|
||||
|
|
|
@ -18,9 +18,6 @@ static void* varVehicleRender = AddressByVersion<void*>(0x6D0E60, 0x6D1680, 0x70
|
|||
WRAPPER void CVehicle::Render() { VARJMP(varVehicleRender); }
|
||||
static void* varIsLawEnforcementVehicle = AddressByVersion<void*>(0x6D2370, 0x6D2BA0, 0x70D8C0);
|
||||
WRAPPER bool CVehicle::IsLawEnforcementVehicle() { VARJMP(varIsLawEnforcementVehicle); }
|
||||
static void* varSetComponentRotation = AddressByVersion<void*>(0x6DBA30, 0, 0);
|
||||
WRAPPER void CVehicle::SetComponentRotation( RwFrame* component, int axis, float angle, bool absolute ) { VARJMP(varSetComponentRotation); }
|
||||
|
||||
void (CAutomobile::*CAutomobile::orgPreRender)();
|
||||
|
||||
static int32_t random(int32_t from, int32_t to)
|
||||
|
@ -139,6 +136,31 @@ void CVehicle::CustomCarPlate_BeforeRenderingStart(CVehicleModelInfo* pModelInfo
|
|||
}
|
||||
}
|
||||
|
||||
void CVehicle::SetComponentRotation( RwFrame* component, int axis, float angle, bool absolute )
|
||||
{
|
||||
if ( component == nullptr ) return;
|
||||
|
||||
CMatrix matrix( RwFrameGetMatrix(component) );
|
||||
if ( absolute )
|
||||
{
|
||||
if ( axis == 0 ) matrix.SetRotateXOnly(angle);
|
||||
else if ( axis == 1 ) matrix.SetRotateYOnly(angle);
|
||||
else if ( axis == 2 ) matrix.SetRotateZOnly(angle);
|
||||
}
|
||||
else
|
||||
{
|
||||
const CVector pos = matrix.GetPos();
|
||||
matrix.SetTranslateOnly(0.0f, 0.0f, 0.0f);
|
||||
|
||||
if ( axis == 0 ) matrix.RotateX(angle);
|
||||
else if ( axis == 1 ) matrix.RotateY(angle);
|
||||
else if ( axis == 2 ) matrix.RotateZ(angle);
|
||||
|
||||
matrix.GetPos() += pos;
|
||||
}
|
||||
matrix.UpdateRW();
|
||||
}
|
||||
|
||||
void CHeli::Render()
|
||||
{
|
||||
double dRotorsSpeed, dMovingRotorSpeed;
|
||||
|
|
|
@ -144,8 +144,8 @@ public:
|
|||
//void CustomCarPlate_AfterRenderingStop(CVehicleModelInfo* pModelInfo);
|
||||
|
||||
bool IsLawEnforcementVehicle();
|
||||
void SetComponentRotation( RwFrame* component, int axis, float angle, bool absolute );
|
||||
|
||||
static void SetComponentRotation( RwFrame* component, int axis, float angle, bool absolute );
|
||||
static void SetComponentAtomicAlpha(RpAtomic* pAtomic, int nAlpha);
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue