diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2021-01-04 19:03:31 +0100 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2021-01-04 19:03:31 +0100 |
commit | 601f77b5c818d870146d829137e83a62cc7b36b9 (patch) | |
tree | be3094ffee8685eef15e969f93fc60acb45d8be0 | |
parent | fix (diff) | |
parent | Double the volume for mission audio in OAL + small fix (diff) | |
download | re3-601f77b5c818d870146d829137e83a62cc7b36b9.tar re3-601f77b5c818d870146d829137e83a62cc7b36b9.tar.gz re3-601f77b5c818d870146d829137e83a62cc7b36b9.tar.bz2 re3-601f77b5c818d870146d829137e83a62cc7b36b9.tar.lz re3-601f77b5c818d870146d829137e83a62cc7b36b9.tar.xz re3-601f77b5c818d870146d829137e83a62cc7b36b9.tar.zst re3-601f77b5c818d870146d829137e83a62cc7b36b9.zip |
-rw-r--r-- | src/audio/sampman_oal.cpp | 11 | ||||
-rw-r--r-- | src/control/Script6.cpp | 2 | ||||
-rw-r--r-- | src/core/Cam.cpp | 11 | ||||
-rw-r--r-- | src/core/re3.cpp | 1 | ||||
-rw-r--r-- | src/entities/Entity.cpp | 10 | ||||
-rw-r--r-- | src/entities/Physical.cpp | 75 | ||||
-rw-r--r-- | src/extras/frontendoption.cpp | 3 | ||||
-rw-r--r-- | src/extras/frontendoption.h | 2 | ||||
-rw-r--r-- | src/fakerw/fake.cpp | 1 | ||||
-rw-r--r-- | src/fakerw/rwplcore.h | 4 |
10 files changed, 77 insertions, 43 deletions
diff --git a/src/audio/sampman_oal.cpp b/src/audio/sampman_oal.cpp index 80f19e50..fd445226 100644 --- a/src/audio/sampman_oal.cpp +++ b/src/audio/sampman_oal.cpp @@ -1542,10 +1542,11 @@ cSampleManager::SetChannelEmittingVolume(uint32 nChannel, uint32 nVolume) nChannelVolume[nChannel] = vol; - if ( MusicManager.GetMusicMode() == MUSICMODE_CUTSCENE - && MusicManager.GetCurrentTrack() != STREAMED_SOUND_CUTSCENE_FINALE ) - { - nChannelVolume[nChannel] = vol / 4; + if (MusicManager.GetMusicMode() == MUSICMODE_CUTSCENE ) { + if (MusicManager.GetCurrentTrack() == STREAMED_SOUND_CUTSCENE_FINALE) + nChannelVolume[nChannel] = 0; + else + nChannelVolume[nChannel] >>= 2; } // no idea, does this one looks like a bug or it's SetChannelVolume ? @@ -1936,7 +1937,7 @@ cSampleManager::SetStreamedVolumeAndPan(uint8 nVolume, uint8 nPan, uint8 nEffect { if ( nEffectFlag ) { if ( nStream == 1 || nStream == 2 ) - stream->SetVolume(128*nVolume*m_nEffectsVolume >> 14); + stream->SetVolume(2*128*nVolume*m_nEffectsVolume >> 14); // double the volume for now as it plays too quiet else stream->SetVolume(m_nEffectsFadeVolume*nVolume*m_nEffectsVolume >> 14); } diff --git a/src/control/Script6.cpp b/src/control/Script6.cpp index 501a7873..b9ec31ee 100644 --- a/src/control/Script6.cpp +++ b/src/control/Script6.cpp @@ -1191,7 +1191,7 @@ int8 CRunningScript::ProcessCommands1100To1199(int32 command) CollectParameters(&m_nIp, 8); CPed *pPed = CPools::GetPedPool()->GetAt(ScriptParams[0]); CVehicle *pVehicle = CPools::GetVehiclePool()->GetAt(ScriptParams[1]); - pPed->AttachPedToEntity(pVehicle, *(CVector*)&ScriptParams[2], ScriptParams[5], DEGTORAD(ScriptParams[6]), (eWeaponType)ScriptParams[7]); + pPed->AttachPedToEntity(pVehicle, *(CVector*)&ScriptParams[2], ScriptParams[5], DEGTORAD(*(float*)&ScriptParams[6]), (eWeaponType)ScriptParams[7]); return 0; } case COMMAND_DETACH_CHAR_FROM_CAR: diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp index 2cf1748c..d4188299 100644 --- a/src/core/Cam.cpp +++ b/src/core/Cam.cpp @@ -2370,8 +2370,10 @@ CCam::Process_M16_1stPerson(const CVector &CameraTarget, float, float, float) Beta += SQR(LookLeftRight/100.0f)*xdir*0.8f/14.0f * FOV/80.0f * CTimer::GetTimeStep(); Alpha += SQR(LookUpDown/150.0f)*ydir*1.0f/14.0f * FOV/80.0f * CTimer::GetTimeStep(); } - while(Beta >= PI) Beta -= 2*PI; - while(Beta < -PI) Beta += 2*PI; + if (!isAttached) { + while(Beta >= TWOPI) Beta -= TWOPI; + while(Beta < 0) Beta += TWOPI; + } if(Alpha > DEGTORAD(60.0f)) Alpha = DEGTORAD(60.0f); else if(Alpha < -DEGTORAD(89.5f)) Alpha = -DEGTORAD(89.5f); @@ -2414,13 +2416,14 @@ CCam::Process_M16_1stPerson(const CVector &CameraTarget, float, float, float) } } }else{ - while(Beta < -PI) Beta += 2*PI; - while(Beta >= PI) Beta -= 2*PI; + while(Beta < -PI) Beta += TWOPI; + while(Beta >= PI) Beta -= TWOPI; } mat = TargetPed->m_attachedTo->GetMatrix(); rot.SetRotateX(Alpha); switch(TargetPed->m_attachType){ + case 0: rot.RotateZ(Beta); break; case 1: rot.RotateZ(Beta + HALFPI); break; case 2: rot.RotateZ(Beta + PI); break; case 3: rot.RotateZ(Beta - HALFPI); break; diff --git a/src/core/re3.cpp b/src/core/re3.cpp index 5523e13c..0e5ed2af 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -225,7 +225,6 @@ void LoadINISettings() void SaveINISettings() { bool changed = false; - char temp[4]; #ifdef DONT_TRUST_RECOGNIZED_JOYSTICKS if (strncmp(cfg.get("DetectJoystick", "JoystickName", "").c_str(), gSelectedJoystickName, strlen(gSelectedJoystickName)) != 0) { diff --git a/src/entities/Entity.cpp b/src/entities/Entity.cpp index 9b6be5f6..c252735e 100644 --- a/src/entities/Entity.cpp +++ b/src/entities/Entity.cpp @@ -126,6 +126,7 @@ CEntity::CreateRwObject(void) m_matrix.AttachRW(RwFrameGetMatrix(RpAtomicGetFrame((RpAtomic*)m_rwObject)), false); else if(RwObjectGetType(m_rwObject) == rpCLUMP) m_matrix.AttachRW(RwFrameGetMatrix(RpClumpGetFrame((RpClump*)m_rwObject)), false); + mi->AddRef(); } } @@ -139,6 +140,7 @@ CEntity::AttachToRwObject(RwObject *obj) m_matrix.Attach(RwFrameGetMatrix(RpAtomicGetFrame((RpAtomic*)m_rwObject)), false); else if(RwObjectGetType(m_rwObject) == rpCLUMP) m_matrix.Attach(RwFrameGetMatrix(RpClumpGetFrame((RpClump*)m_rwObject)), false); + CModelInfo::GetModelInfo(m_modelIndex)->AddRef(); } } @@ -239,12 +241,8 @@ CEntity::GetBoundRadius(void) void CEntity::UpdateRwFrame(void) { - if(m_rwObject){ - if(RwObjectGetType(m_rwObject) == rpATOMIC) - RwFrameUpdateObjects(RpAtomicGetFrame((RpAtomic*)m_rwObject)); - else if(RwObjectGetType(m_rwObject) == rpCLUMP) - RwFrameUpdateObjects(RpClumpGetFrame((RpClump*)m_rwObject)); - } + if(m_rwObject) + RwFrameUpdateObjects(rwObjectGetParent(m_rwObject)); } void diff --git a/src/entities/Physical.cpp b/src/entities/Physical.cpp index acf9c702..706b469c 100644 --- a/src/entities/Physical.cpp +++ b/src/entities/Physical.cpp @@ -235,6 +235,7 @@ CPhysical::GetBoundRect(void) return CRect(center.x-radius, center.y-radius, center.x+radius, center.y+radius); } +// --MIAMI: Proof-read once void CPhysical::AddToMovingList(void) { @@ -242,6 +243,7 @@ CPhysical::AddToMovingList(void) m_movingListNode = CWorld::GetMovingEntityList().InsertItem(this); } +// --MIAMI: Proof-read once void CPhysical::RemoveFromMovingList(void) { @@ -261,12 +263,14 @@ CPhysical::SetDamagedPieceRecord(uint16 piece, float impulse, CEntity *entity, C m_vecDamageNormal = dir; } +// --MIAMI: Proof-read once void CPhysical::AddCollisionRecord(CEntity *ent) { AddCollisionRecord_Treadable(ent); this->bHasCollided = true; ent->bHasCollided = true; + this->m_nLastTimeCollided = CTimer::GetTimeInMilliseconds(); if(IsVehicle() && ent->IsVehicle()){ if(((CVehicle*)this)->m_nAlarmState == -1) ((CVehicle*)this)->m_nAlarmState = 15000; @@ -280,10 +284,10 @@ CPhysical::AddCollisionRecord(CEntity *ent) return; if(m_nCollisionRecords < PHYSICAL_MAX_COLLISIONRECORDS) m_aCollisionRecords[m_nCollisionRecords++] = ent; - m_nLastTimeCollided = CTimer::GetTimeInMilliseconds(); } } +// --MIAMI: Proof-read once void CPhysical::AddCollisionRecord_Treadable(CEntity *ent) { @@ -291,6 +295,7 @@ CPhysical::AddCollisionRecord_Treadable(CEntity *ent) } } +// --MIAMI: Proof-read once bool CPhysical::GetHasCollidedWith(CEntity *ent) { @@ -302,20 +307,23 @@ CPhysical::GetHasCollidedWith(CEntity *ent) return false; } +// --MIAMI: Proof-read once void CPhysical::RemoveRefsToEntity(CEntity *ent) { - int i, j; + int i = 0, j; - for(i = 0; i < m_nCollisionRecords; i++){ + while (i < m_nCollisionRecords){ if(m_aCollisionRecords[i] == ent){ for(j = i; j < m_nCollisionRecords-1; j++) m_aCollisionRecords[j] = m_aCollisionRecords[j+1]; m_nCollisionRecords--; - } + } else + i++; } } +// --MIAMI: Proof-read once void CPhysical::PlacePhysicalRelativeToOtherPhysical(CPhysical *other, CPhysical *phys, CVector localPos) { @@ -332,6 +340,7 @@ CPhysical::PlacePhysicalRelativeToOtherPhysical(CPhysical *other, CPhysical *phy CWorld::Add(phys); } +// --MIAMI: Proof-read once int32 CPhysical::ProcessEntityCollision(CEntity *ent, CColPoint *colpoints) { @@ -350,6 +359,7 @@ CPhysical::ProcessEntityCollision(CEntity *ent, CColPoint *colpoints) return numSpheres; } +// --MIAMI: Proof-read once void CPhysical::ProcessControl(void) { @@ -417,6 +427,7 @@ CPhysical::GetSpeed(const CVector &r) return m_vecMoveSpeed + m_vecMoveFriction + CrossProduct(m_vecTurnFriction + m_vecTurnSpeed, r); } +// --MIAMI: Proof-read once void CPhysical::ApplyMoveSpeed(void) { @@ -426,7 +437,7 @@ CPhysical::ApplyMoveSpeed(void) GetMatrix().Translate(m_vecMoveSpeed * CTimer::GetTimeStep()); } - +// --MIAMI: Proof-read once void CPhysical::ApplyTurnSpeed(void) { @@ -442,12 +453,14 @@ CPhysical::ApplyTurnSpeed(void) } } +// --MIAMI: Proof-read once void CPhysical::ApplyMoveForce(float jx, float jy, float jz) { m_vecMoveSpeed += CVector(jx, jy, jz)*(1.0f/m_fMass); } +// --MIAMI: Proof-read once void CPhysical::ApplyTurnForce(float jx, float jy, float jz, float px, float py, float pz) { @@ -462,6 +475,7 @@ CPhysical::ApplyFrictionMoveForce(float jx, float jy, float jz) m_vecMoveFriction += CVector(jx, jy, jz)*(1.0f/m_fMass); } +// --MIAMI: Proof-read once void CPhysical::ApplyFrictionTurnForce(float jx, float jy, float jz, float px, float py, float pz) { @@ -470,6 +484,7 @@ CPhysical::ApplyFrictionTurnForce(float jx, float jy, float jz, float px, float m_vecTurnFriction += turnimpulse*(1.0f/m_fTurnMass); } +// --MIAMI: Proof-read once bool CPhysical::ApplySpringCollision(float springConst, CVector &springDir, CVector &point, float springRatio, float bias) { @@ -483,6 +498,7 @@ CPhysical::ApplySpringCollision(float springConst, CVector &springDir, CVector & return true; } +// --MIAMI: Proof-read once bool CPhysical::ApplySpringCollisionAlt(float springConst, CVector &springDir, CVector &point, float springRatio, float bias, CVector &forceDir) { @@ -500,6 +516,7 @@ CPhysical::ApplySpringCollisionAlt(float springConst, CVector &springDir, CVecto return true; } +// --MIAMI: Proof-read once // What exactly is speed? bool CPhysical::ApplySpringDampening(float damping, CVector &springDir, CVector &point, CVector &speed) @@ -560,17 +577,16 @@ CPhysical::ApplyFriction(void) m_vecTurnFriction = CVector(0.0f, 0.0f, 0.0f); } +// --MIAMI: Proof-read once void CPhysical::ApplyAirResistance(void) { if(m_fAirResistance > 0.1f){ - if(GetStatus() != STATUS_GHOST){ - float f = Pow(m_fAirResistance, CTimer::GetTimeStep()); - m_vecMoveSpeed *= f; - m_vecTurnSpeed *= f; - } - }else{ - float f = Pow(1.0f/(m_fAirResistance*0.5f*m_vecMoveSpeed.MagnitudeSqr() + 1.0f), CTimer::GetTimeStep()); + float f = Pow(m_fAirResistance, CTimer::GetTimeStep()); + m_vecMoveSpeed *= f; + m_vecTurnSpeed *= f; + }else if(GetStatus() != STATUS_GHOST){ + float f = Pow(1.0f/Abs(1.0f + m_fAirResistance*0.5f*m_vecMoveSpeed.MagnitudeSqr()), CTimer::GetTimeStep()); m_vecMoveSpeed *= f; m_vecTurnSpeed *= 0.99f; } @@ -1015,6 +1031,7 @@ CPhysical::ApplyCollisionAlt(CEntity *B, CColPoint &colpoint, float &impulse, CV return false; } +// --MIAMI: Proof-read once bool CPhysical::ApplyFriction(CPhysical *B, float adhesiveLimit, CColPoint &colpoint) { @@ -1044,7 +1061,11 @@ CPhysical::ApplyFriction(CPhysical *B, float adhesiveLimit, CColPoint &colpoint) impulseB = (speedSum - fOtherSpeedB) * B->m_fMass; impulseLimit = adhesiveLimit*CTimer::GetTimeStep(); if(impulseA < -impulseLimit) impulseA = -impulseLimit; - if(impulseB > impulseLimit) impulseB = impulseLimit; // BUG: game has A's clamp again here, but this can't be right +#ifdef FIX_BUGS + if(impulseB > impulseLimit) impulseB = impulseLimit; +#else + if(impulseA < -impulseLimit) impulseA = -impulseLimit; // duplicate +#endif A->ApplyFrictionMoveForce(frictionDir*impulseA); B->ApplyFrictionMoveForce(frictionDir*impulseB); return true; @@ -1139,6 +1160,7 @@ CPhysical::ApplyFriction(CPhysical *B, float adhesiveLimit, CColPoint &colpoint) return false; } +// --MIAMI: Proof-read once bool CPhysical::ApplyFriction(float adhesiveLimit, CColPoint &colpoint) { @@ -1176,7 +1198,7 @@ CPhysical::ApplyFriction(float adhesiveLimit, CColPoint &colpoint) if(fOtherSpeed > 0.0f){ frictionDir = vOtherSpeed * (1.0f/fOtherSpeed); fImpulse = -fOtherSpeed * m_fMass; - impulseLimit = adhesiveLimit*CTimer::GetTimeStep() * 1.5f; + impulseLimit = adhesiveLimit*CTimer::GetTimeStep() * 1.5; if(fImpulse < -impulseLimit) fImpulse = -impulseLimit; ApplyFrictionMoveForce(frictionDir*fImpulse); ApplyFrictionTurnForce(frictionDir*fImpulse, pointpos); @@ -1194,6 +1216,7 @@ CPhysical::ApplyFriction(float adhesiveLimit, CColPoint &colpoint) return false; } +// --MIAMI: Proof-read once bool CPhysical::ProcessShiftSectorList(CPtrList *lists) { @@ -1267,7 +1290,8 @@ CPhysical::ProcessShiftSectorList(CPtrList *lists) skipShift = true; Aobj->m_pCollidingEntity = B; } - } + } else + skipShift = true; }else if(B->IsObject() && A->IsVehicle()){ CObject *Bobj = (CObject*)B; if(Bobj->ObjectCreatedBy != TEMP_OBJECT && @@ -1282,7 +1306,8 @@ CPhysical::ProcessShiftSectorList(CPtrList *lists) if(size.z < A->GetPosition().z || (Invert(A->GetMatrix(), inv) * size).z < 0.0f) skipShift = true; - } + } else + skipShift = true; }else if(IsBodyPart(A->GetModelIndex()) && B->IsPed()) skipShift = true; else if(A->IsPed() && IsBodyPart(B->GetModelIndex())) @@ -1354,6 +1379,7 @@ CPhysical::ProcessShiftSectorList(CPtrList *lists) return true; } +// --MIAMI: Proof-read once bool CPhysical::ProcessCollisionSectorList_SimpleCar(CPtrList *lists) { @@ -1520,6 +1546,7 @@ collision: return true; } +// --MIAMI: Proof-read once bool CPhysical::ProcessCollisionSectorList(CPtrList *lists) { @@ -1656,8 +1683,7 @@ CPhysical::ProcessCollisionSectorList(CPtrList *lists) return true; if(numCollisions == 0 && A == (CEntity*)FindPlayerPed() && Aped->m_pCollidingEntity == B) Aped->m_pCollidingEntity = nil; - }else if(B->IsBuilding() || B->bIsStuck || B->bInfiniteMass || altcollision){ - + }else if(B->IsBuilding() || B->bIsStuck || B->m_phy_flagA08 || altcollision){ // This is the case where B doesn't move B->m_scanCode = CWorld::GetCurrentScanCode(); @@ -1925,18 +1951,22 @@ CPhysical::ProcessCollisionSectorList(CPtrList *lists) CMatrix inv; CVector size = CModelInfo::GetModelInfo(B->GetModelIndex())->GetColModel()->boundingBox.GetSize(); size = B->GetMatrix() * size; - if(size.z < B->GetPosition().z || + if(size.z < A->GetPosition().z || (Invert(A->GetMatrix(), inv) * size).z < 0.0f) Bobj->ObjectDamage(50.0f); } }else if(A->IsObject() && A->bUsesCollision && B->IsVehicle()){ if(Aobj->m_nCollisionDamageEffect && maxImpulseB > 20.0f) Aobj->ObjectDamage(maxImpulseB); +#ifdef FIX_BUGS else if(Aobj->m_nCollisionDamageEffect >= DAMAGE_EFFECT_SMASH_COMPLETELY){ +#else + else if(Bobj->m_nCollisionDamageEffect >= DAMAGE_EFFECT_SMASH_COMPLETELY){ +#endif CMatrix inv; CVector size = CModelInfo::GetModelInfo(A->GetModelIndex())->GetColModel()->boundingBox.GetSize(); size = A->GetMatrix() * size; - if(size.z < A->GetPosition().z || + if(size.z < B->GetPosition().z || (Invert(B->GetMatrix(), inv) * size).z < 0.0f) Aobj->ObjectDamage(50.0f); } @@ -1987,6 +2017,7 @@ CPhysical::CheckCollision_SimpleCar(void) float PHYSICAL_SHIFT_SPEED_DAMP = 0.707f; +// --MIAMI: Proof-read once void CPhysical::ProcessShift(void) { @@ -1997,8 +2028,8 @@ CPhysical::ProcessShift(void) RemoveAndAdd(); }else{ CPhysical *surf; - if(bHasHitWall && IsPed() && (surf = ((CPed*)this)->m_pCurrentPhysSurface, surf == nil || !surf->bInfiniteMass || surf->m_phy_flagA08) || - CWorld::bSecondShift){ + if(bHasHitWall && (IsPed() && (surf = ((CPed*)this)->m_pCurrentPhysSurface, surf == nil || !surf->bInfiniteMass || surf->m_phy_flagA08) || + CWorld::bSecondShift)){ m_vecMoveSpeed *= Pow(PHYSICAL_SHIFT_SPEED_DAMP, CTimer::GetTimeStep()); m_vecTurnSpeed *= Pow(PHYSICAL_SHIFT_SPEED_DAMP, CTimer::GetTimeStep()); } diff --git a/src/extras/frontendoption.cpp b/src/extras/frontendoption.cpp index 1f154250..8a95a49a 100644 --- a/src/extras/frontendoption.cpp +++ b/src/extras/frontendoption.cpp @@ -111,7 +111,7 @@ void FrontendOptionAddBuiltinAction(const char* gxtKey, uint16 x, uint16 y, uint option.m_TargetMenu = targetMenu; } -void FrontendOptionAddSelect(const char* gxtKey, uint16 x, uint16 y, uint8 align, const char** rightTexts, int8 numRightTexts, int8 *var, bool onlyApplyOnEnter, ChangeFunc changeFunc, const char* saveName) +void FrontendOptionAddSelect(const char* gxtKey, uint16 x, uint16 y, uint8 align, const char** rightTexts, int8 numRightTexts, int8 *var, bool onlyApplyOnEnter, ChangeFunc changeFunc, const char* saveName, bool disableIfGameLoaded) { int8 screenOptionOrder = RegisterNewOption(); @@ -133,6 +133,7 @@ void FrontendOptionAddSelect(const char* gxtKey, uint16 x, uint16 y, uint8 align option.m_CFOSelect->save = saveName; option.m_CFOSelect->onlyApplyOnEnter = onlyApplyOnEnter; option.m_CFOSelect->changeFunc = changeFunc; + option.m_CFOSelect->disableIfGameLoaded = disableIfGameLoaded; } void FrontendOptionAddDynamic(const char* gxtKey, uint16 x, uint16 y, uint8 align, DrawFunc drawFunc, int8 *var, ButtonPressFunc buttonPressFunc, const char* saveName) diff --git a/src/extras/frontendoption.h b/src/extras/frontendoption.h index 6670c323..2719f076 100644 --- a/src/extras/frontendoption.h +++ b/src/extras/frontendoption.h @@ -78,7 +78,7 @@ void FrontendOptionSetCursor(int screen, int8 option, bool overwrite = false); // var is optional in AddDynamic, enables you to save them in an INI file(also needs passing char array to saveName param. obv), otherwise pass nil/0 void FrontendOptionAddBuiltinAction(const char* gxtKey, uint16 x, uint16 y, uint8 align, int action, int targetMenu = MENUPAGE_NONE, int saveSlot = SAVESLOT_NONE); -void FrontendOptionAddSelect(const char* gxtKey, uint16 x, uint16 y, uint8 align, const char** rightTexts, int8 numRightTexts, int8 *var, bool onlyApplyOnEnter, ChangeFunc changeFunc, const char* saveName = nil); +void FrontendOptionAddSelect(const char* gxtKey, uint16 x, uint16 y, uint8 align, const char** rightTexts, int8 numRightTexts, int8 *var, bool onlyApplyOnEnter, ChangeFunc changeFunc, const char* saveName = nil, bool disableIfGameLoaded = false); void FrontendOptionAddDynamic(const char* gxtKey, uint16 x, uint16 y, uint8 align, DrawFunc rightTextDrawFunc, int8 *var, ButtonPressFunc buttonPressFunc, const char* saveName = nil); // lineHeight = 0 means game will use MENU_DEFAULT_LINE_HEIGHT diff --git a/src/fakerw/fake.cpp b/src/fakerw/fake.cpp index 37567927..863407b9 100644 --- a/src/fakerw/fake.cpp +++ b/src/fakerw/fake.cpp @@ -14,6 +14,7 @@ using namespace rw; RwUInt8 RwObjectGetType(const RwObject *obj) { return obj->type; } +RwFrame* rwObjectGetParent(const RwObject *obj) { return (RwFrame*)obj->parent; } void *RwMalloc(size_t size) { return engine->memfuncs.rwmalloc(size, 0); } diff --git a/src/fakerw/rwplcore.h b/src/fakerw/rwplcore.h index 511f7678..69c921cc 100644 --- a/src/fakerw/rwplcore.h +++ b/src/fakerw/rwplcore.h @@ -108,12 +108,12 @@ enum RwCorePluginID //struct RwObject; typedef rw::Object RwObject; +typedef rw::Frame RwFrame; typedef RwObject *(*RwObjectCallBack)(RwObject *object, void *data); RwUInt8 RwObjectGetType(const RwObject *obj); - - +RwFrame* rwObjectGetParent(const RwObject *obj); #define rwsprintf sprintf #define rwvsprintf vsprintf |