From b8cce79a5a6e342ab081a6c61e03bf88bc9de30c Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 21 Jan 2017 16:23:45 -0500 Subject: TITANIC: Reorder class types setup so all ancestors come first --- engines/titanic/core/saveable_object.cpp | 200 ++++++++++++++++--------------- 1 file changed, 101 insertions(+), 99 deletions(-) (limited to 'engines/titanic/core') diff --git a/engines/titanic/core/saveable_object.cpp b/engines/titanic/core/saveable_object.cpp index 3f69186139..8bb8a92b7f 100644 --- a/engines/titanic/core/saveable_object.cpp +++ b/engines/titanic/core/saveable_object.cpp @@ -1022,72 +1022,82 @@ DEFFN(CTimeEventInfo); void CSaveableObject::initClassList() { _classDefs = new ClassDefList(); _classList = new ClassListMap(); + + // Setup the type definitions for each class. Note that these have to be + // in order of hierarchy from ancestor class to descendent + ADDFN(CSaveableObject, CSaveableObject); + ADDFN(CMessage, CSaveableObject); + ADDFN(CMessageTarget, CSaveableObject); + ADDFN(CResourceKey, CSaveableObject); + ADDFN(ListItem, CSaveableObject); + ADDFN(CTreeItem, CMessageTarget); + ADDFN(CFileItem, CTreeItem); + ADDFN(CGameObjectDescItem, CTreeItem); + ADDFN(CDontSaveFileItem, CFileItem); + ADDFN(CProjectItem, CFileItem); + ADDFN(CNamedItem, CTreeItem); + ADDFN(CRoomItem, CNamedItem); + ADDFN(CGameObject, CNamedItem); + ADDFN(CLinkItem, CNamedItem); + ADDFN(CNodeItem, CNamedItem); + ADDFN(CPlaceHolderItem, CNamedItem); + ADDFN(CViewItem, CNamedItem); + ADDFN(CBackground, CGameObject); + ADDFN(CClickResponder, CGameObject); + ADDFN(CDropTarget, CGameObject); + ADDFN(CFileListItem, ListItem); + ADDFN(CMailMan, CGameObject); + ADDFN(CMovieClip, ListItem); + ADDFN(CMultiDropTarget, CDropTarget); + ADDFN(CStartAction, CBackground); + ADDFN(CEditControl, CGameObject); + ADDFN(CToggleButton, CBackground); + ADDFN(CToggleSwitch, CGameObject); + ADDFN(CPlaceHolder, CGameObject); + + ADDFN(CCarry, CGameObject); ADDFN(CArm, CCarry); - ADDFN(CAuditoryCentre, CBrain); - ADDFN(CBowlEar, CEar); ADDFN(CBrain, CCarry); ADDFN(CBridgePiece, CCarry); - ADDFN(CCarry, CGameObject); ADDFN(CCarryParrot, CCarry); - ADDFN(CCentralCore, CBrain); ADDFN(CChicken, CCarry); ADDFN(CCrushedTV, CCarry); - ADDFN(CEar, CHeadPiece); - ADDFN(CEye, CHeadPiece); ADDFN(CFeathers, CCarry); ADDFN(CFruit, CCarry); ADDFN(CGlass, CCarry); ADDFN(CHammer, CCarry); ADDFN(CHeadPiece, CCarry); ADDFN(CHose, CCarry); - ADDFN(CHoseEnd, CHose); ADDFN(CKey, CCarry); ADDFN(CLiftbotHead, CCarry); ADDFN(CLongStick, CCarry); ADDFN(CMagazine, CCarry); - ADDFN(CMaitreDLeftArm, CArm); - ADDFN(CMaitreDRightArm, CArm); - ADDFN(CMouth, CHeadPiece); ADDFN(CNapkin, CCarry); - ADDFN(CNose, CHeadPiece); ADDFN(CNote, CCarry); ADDFN(CParcel, CCarry); - ADDFN(CPerch, CCentralCore); ADDFN(CPhonographCylinder, CCarry); - ADDFN(CPhonographEar, CEar); ADDFN(CPhotograph, CCarry); ADDFN(CPlugIn, CCarry); - ADDFN(CSpeechCentre, CBrain); ADDFN(CSweets, CCarry); + ADDFN(CMaitreDLeftArm, CArm); + ADDFN(CMaitreDRightArm, CArm); + ADDFN(CCentralCore, CBrain); + ADDFN(CSpeechCentre, CBrain); ADDFN(CVisionCentre, CBrain); + ADDFN(CAuditoryCentre, CBrain); + ADDFN(CPerch, CCentralCore); + ADDFN(CEar, CHeadPiece); + ADDFN(CBowlEar, CEar); + ADDFN(CPhonographEar, CEar); + ADDFN(CEye, CHeadPiece); + ADDFN(CMouth, CHeadPiece); + ADDFN(CNose, CHeadPiece); + ADDFN(CHoseEnd, CHose); - ADDFN(CBackground, CGameObject); - ADDFN(CClickResponder, CGameObject); - ADDFN(CDontSaveFileItem, CFileItem); - ADDFN(CDropTarget, CGameObject); - ADDFN(CFileItem, CTreeItem); - ADDFN(CFileListItem, ListItem); - ADDFN(CGameObject, CNamedItem); - ADDFN(CGameObjectDescItem, CTreeItem); - ADDFN(CLinkItem, CNamedItem); - ADDFN(ListItem, CSaveableObject); - ADDFN(CMessageTarget, CSaveableObject); - ADDFN(CMailMan, CGameObject); - ADDFN(CMovieClip, ListItem); - ADDFN(CMultiDropTarget, CDropTarget); - ADDFN(CNamedItem, CTreeItem); - ADDFN(CNodeItem, CNamedItem); - ADDFN(CProjectItem, CFileItem); - ADDFN(CResourceKey, CSaveableObject); - ADDFN(CRoomItem, CNamedItem); - ADDFN(CSaveableObject, CSaveableObject); ADDFN(CStaticImage, CGameObject); ADDFN(CTurnOnObject, CBackground); - ADDFN(CTreeItem, CMessageTarget); ADDFN(CTurnOnPlaySound, CTurnOnObject); ADDFN(CTurnOnTurnOff, CBackground); - ADDFN(CViewItem, CNamedItem); - ADDFN(CAnnounce, CGameObject); ADDFN(CAnnoyBarbot, CGameObject); ADDFN(CArbBackground, CBackground); @@ -1097,7 +1107,6 @@ void CSaveableObject::initClassList() { ADDFN(CBarMenu, CGameObject); ADDFN(CBarMenuButton, CGameObject); ADDFN(CBelbotGetLight, CGameObject); - ADDFN(CBilgeSuccUBus, CSuccUBus); ADDFN(CBomb, CBackground); ADDFN(CBottomOfWellMonitor, CGameObject); ADDFN(CBowlUnlocker, CGameObject); @@ -1130,8 +1139,6 @@ void CSaveableObject::initClassList() { ADDFN(CDoorbotElevatorHandler, CGameObject); ADDFN(CDoorbotHomeHandler, CGameObject); ADDFN(CDropTarget, CGameObject); - ADDFN(CEarSweetBowl, CSweetBowl); - ADDFN(CEjectPhonographButton, CBackground); ADDFN(CElevatorActionArea, CGameObject); ADDFN(CEmmaControl, CBackground); ADDFN(CEmptyNutBowl, CGameObject); @@ -1167,9 +1174,6 @@ void CSaveableObject::initClassList() { ADDFN(CMissiveOMatButton, CEditControl); ADDFN(CMovieTester, CGameObject); ADDFN(CMusicalInstrument, CBackground); - ADDFN(CMusicConsoleButton, CMusicPlayer); - ADDFN(CMusicRoomPhonograph, CRestaurantPhonograph); - ADDFN(CMusicRoomStopPhonographButton, CEjectPhonographButton); ADDFN(CMusicSystemLock, CDropTarget); ADDFN(CNavHelmet, CGameObject); ADDFN(CNavHelmetOn, CGameObject); @@ -1180,9 +1184,7 @@ void CSaveableObject::initClassList() { ADDFN(CNullPortHole, CClickResponder); ADDFN(CNutReplacer, CGameObject); ADDFN(CPetDisabler, CGameObject); - ADDFN(CPhonograph, CMusicPlayer); ADDFN(CPhonographLid, CGameObject); - ADDFN(CPlaceHolderItem, CNamedItem); ADDFN(CPlayMusicButton, CBackground); ADDFN(CPlayOnAct, CBackground); ADDFN(CPortHole, CGameObject); @@ -1190,7 +1192,6 @@ void CSaveableObject::initClassList() { ADDFN(CReplacementEar, CBackground); ADDFN(CReservedTable, CGameObject); ADDFN(CRestaurantCylinderHolder, CDropTarget); - ADDFN(CRestaurantPhonograph, CPhonograph); ADDFN(CSauceDispensor, CBackground); ADDFN(CSearchPoint, CGameObject); ADDFN(CSeasonBackground, CBackground); @@ -1203,11 +1204,11 @@ void CSaveableObject::initClassList() { ADDFN(CSpeechDispensor, CBackground); ADDFN(CSplashAnimation, CGameObject); ADDFN(CStarlingPuret, CGameObject); - ADDFN(CStartAction, CBackground); ADDFN(CStopPhonographButton, CBackground); ADDFN(CSUBGlass, CGameObject); ADDFN(CSUBWrapper, CGameObject); ADDFN(CSweetBowl, CGameObject); + ADDFN(CEarSweetBowl, CSweetBowl); ADDFN(CTelevision, CBackground); ADDFN(CThirdClassCanal, CBackground); ADDFN(CThrowTVDownWell, CGameObject); @@ -1227,9 +1228,9 @@ void CSaveableObject::initClassList() { ADDFN(CGondolierMixer, CGondolierBase); ADDFN(CGondolierSlider, CGondolierBase); ADDFN(CMaitreDArmHolder, CDropTarget); + ADDFN(CMaitreDProdReceptor, CGameObject); ADDFN(CMaitreDBody, CMaitreDProdReceptor); ADDFN(CMaitreDLegs, CMaitreDProdReceptor); - ADDFN(CMaitreDProdReceptor, CGameObject); ADDFN(CParrotLobbyObject, CGameObject); ADDFN(CParrotLobbyController, CParrotLobbyObject); ADDFN(CParrotLobbyLinkUpdater, CParrotLobbyObject); @@ -1238,21 +1239,20 @@ void CSaveableObject::initClassList() { ADDFN(CParrotNutBowlActor, CGameObject); ADDFN(CParrotNutEater, CGameObject); ADDFN(CParrotPerchHolder, CMultiDropTarget); - ADDFN(CParrotSuccUBus, CSuccUBus); ADDFN(CParrotTrigger, CGameObject); ADDFN(CPlayerMeetsParrot, CGameObject); ADDFN(CPET, CGameObject); ADDFN(CPETClass1, CGameObject); ADDFN(CPETClass2, CGameObject); ADDFN(CPETClass3, CGameObject); - ADDFN(CPETLift, CPETTransport); ADDFN(CPETMonitor, CGameObject); - ADDFN(CPETPellerator, CPETTransport); ADDFN(CPETPosition, CGameObject); ADDFN(CPETSentinal, CGameObject); ADDFN(CPETSounds, CGameObject); ADDFN(CPETTransition, CGameObject); ADDFN(CPETTransport, CGameObject); + ADDFN(CPETPellerator, CPETTransport); + ADDFN(CPETLift, CPETTransport); ADDFN(CPickUp, CGameObject); ADDFN(CPickUpBarGlass, CPickUp); ADDFN(CPickUpHose, CPickUp); @@ -1261,8 +1261,8 @@ void CSaveableObject::initClassList() { ADDFN(CPickUpVisCentre, CPickUp); ADDFN(CBarShelfVisCentre, CPlaceHolder); ADDFN(CLemonOnBar, CPlaceHolder); - ADDFN(CPlaceHolder, CGameObject); ADDFN(CTVOnBar, CPlaceHolder); + ADDFN(CSGTStateRoom, CBackground); ADDFN(CArmchair, CSGTStateRoom); ADDFN(CBasin, CSGTStateRoom); ADDFN(CBedfoot, CSGTStateRoom); @@ -1276,40 +1276,34 @@ void CSaveableObject::initClassList() { ADDFN(CSGTNavigation, CGameObject); ADDFN(CSGTRestaurantDoors, CGameObject); ADDFN(CSGTStateControl, CBackground); - ADDFN(CSGTStateRoom, CBackground); ADDFN(CSGTTV, CSGTStateRoom); ADDFN(CSGTUpperDoorsSound, CClickResponder); ADDFN(CToilet, CSGTStateRoom); ADDFN(CVase, CSGTStateRoom); ADDFN(CWashstand, CSGTStateRoom); - ADDFN(CGondolier, CTransport); - ADDFN(CLift, CTransport); - ADDFN(CLiftindicator, CLift); - ADDFN(CPellerator, CTransport); - ADDFN(CServiceElevator, CTransport); - ADDFN(CTransport, CMobile); - + ADDFN(CPetGraphic, CGameObject); + ADDFN(CPetGraphic2, CGameObject); + ADDFN(CSTButton, CBackground); ADDFN(CActButton, CSTButton); ADDFN(CChangesSeasonButton, CSTButton); + ADDFN(CElevatorButton, CSTButton); + ADDFN(CIconNavButt, CPetGraphic); + ADDFN(CIconNavImage, CPetGraphic); + ADDFN(CIconNavReceive, CPetGraphic); + ADDFN(CIconNavSend, CPetGraphic); ADDFN(CChevLeftOff, CToggleSwitch); ADDFN(CChevLeftOn, CToggleSwitch); ADDFN(CChevRightOff, CToggleSwitch); ADDFN(CChevRightOn, CToggleSwitch); ADDFN(CChevSendRecSwitch, CToggleSwitch); - ADDFN(CEditControl, CGameObject); - ADDFN(CElevatorButton, CSTButton); ADDFN(CGetFromSucc, CToggleSwitch); ADDFN(CHelmetOnOff, CToggleSwitch); ADDFN(CHomePhoto, CToggleSwitch); ADDFN(CIconNavAction, CToggleSwitch); - ADDFN(CIconNavButt, CPetGraphic); ADDFN(CIconNavDown, CToggleSwitch); - ADDFN(CIconNavImage, CPetGraphic); ADDFN(CIconNavLeft, CToggleSwitch); - ADDFN(CIconNavReceive, CPetGraphic); ADDFN(CIconNavRight, CToggleSwitch); - ADDFN(CIconNavSend, CPetGraphic); ADDFN(CIconNavUp, CToggleSwitch); ADDFN(CKeybrdButt, CToggleSwitch); ADDFN(CMoveObjectButton, CSTButton); @@ -1323,8 +1317,6 @@ void CSaveableObject::initClassList() { ADDFN(CMusicVoiceMute, CMusicControl); ADDFN(CPetControl, CGameObject); ADDFN(CPetDragChev, CPetGraphic2); - ADDFN(CPetGraphic, CGameObject); - ADDFN(CPetGraphic2, CGameObject); ADDFN(PETLeaf, CGameObject); ADDFN(CPetModeOff, CToggleSwitch); ADDFN(CPetModeOn, CToggleSwitch); @@ -1341,12 +1333,9 @@ void CSaveableObject::initClassList() { ADDFN(CSmallChevRightOff, CToggleSwitch); ADDFN(CSmallChevRightOn, CToggleSwitch); ADDFN(CStatusChangeButton, CSTButton); - ADDFN(CSTButton, CBackground); ADDFN(CTextDown, CPetGraphic); ADDFN(CTextSkrew, CPetGraphic); ADDFN(CTextUp, CPetGraphic); - ADDFN(CToggleButton, CBackground); - ADDFN(CToggleSwitch, CGameObject); ADDFN(CActMsg, CMessage); ADDFN(CActivationmsg, CMessage); @@ -1415,7 +1404,6 @@ void CSaveableObject::initClassList() { ADDFN(CLockPhonographMsg, CMessage); ADDFN(CMaitreDDefeatedMsg, CMessage); ADDFN(CMaitreDHappyMsg, CMessage); - ADDFN(CMessage, CSaveableObject); ADDFN(CMissiveOMatActionMsg, CMessage); ADDFN(CMouseMsg, CMessage); ADDFN(CMouseMoveMsg, CMouseMsg); @@ -1551,33 +1539,35 @@ void CSaveableObject::initClassList() { ADDFN(CVirtualKeyCharMsg, CMessage); ADDFN(CVisibleMsg, CMessage); + ADDFN(CMovePlayerTo, CGameObject); + ADDFN(CMovePlayerToFrom, CGameObject); ADDFN(CEnterBombRoom, CMovePlayerTo); + ADDFN(CExitArboretum, CMovePlayerTo); + ADDFN(CExitBridge, CMovePlayerTo); + ADDFN(CExitStateRoom, CMovePlayerTo); + ADDFN(CMovePlayerInParrotRoom, CMovePlayerTo); + ADDFN(CExitTiania, CMovePlayerTo); + ADDFN(CMultiMove, CMovePlayerTo); + ADDFN(CRestaurantPanHandler, CMovePlayerTo); + ADDFN(CPanFromPel, CMovePlayerTo); + ADDFN(CRestrictedMove, CMovePlayerTo); + ADDFN(CTripDownCanal, CMovePlayerTo); ADDFN(CEnterBridge, CGameObject); ADDFN(CEnterExitFirstClassState, CGameObject); ADDFN(CEnterExitMiniLift, CSGTNavigation); ADDFN(CEnterExitSecClassMiniLift, CGameObject); ADDFN(CEnterExitView, CGameObject); ADDFN(CEnterSecClassState, CGameObject); - ADDFN(CExitArboretum, CMovePlayerTo); - ADDFN(CExitBridge, CMovePlayerTo); ADDFN(CExitLift, CGameObject); ADDFN(CExitPellerator, CGameObject); - ADDFN(CExitStateRoom, CMovePlayerTo); - ADDFN(CExitTiania, CMovePlayerTo); - ADDFN(CMovePlayerInParrotRoom, CMovePlayerTo); - ADDFN(CMovePlayerTo, CGameObject); - ADDFN(CMovePlayerToFrom, CGameObject); - ADDFN(CMultiMove, CMovePlayerTo); - ADDFN(CPanFromPel, CMovePlayerTo); - ADDFN(CRestaurantPanHandler, CMovePlayerTo); ADDFN(CScraliontisTable, CRestaurantPanHandler); - ADDFN(CRestrictedMove, CMovePlayerTo); - ADDFN(CTripDownCanal, CMovePlayerTo); + ADDFN(CCharacter, CGameObject); + ADDFN(CStarlings, CCharacter); + ADDFN(CTrueTalkNPC, CCharacter); ADDFN(CBarbot, CTrueTalkNPC); ADDFN(CBellBot, CTrueTalkNPC); ADDFN(CCallBot, CGameObject); - ADDFN(CCharacter, CGameObject); ADDFN(CDeskbot, CTrueTalkNPC); ADDFN(CDoorbot, CTrueTalkNPC); ADDFN(CMaitreD, CTrueTalkNPC); @@ -1585,36 +1575,48 @@ void CSaveableObject::initClassList() { ADDFN(CMobile, CCharacter); ADDFN(CParrot, CTrueTalkNPC); ADDFN(CRobotController, CGameObject); - ADDFN(CStarlings, CCharacter); ADDFN(CSuccUBus, CTrueTalkNPC); + ADDFN(CBilgeSuccUBus, CSuccUBus); + ADDFN(CParrotSuccUBus, CSuccUBus); ADDFN(CSummonBots, CRobotController); ADDFN(CTitania, CCharacter); - ADDFN(CTrueTalkNPC, CCharacter); + ADDFN(CTransport, CMobile); + ADDFN(CGondolier, CTransport); + ADDFN(CLift, CTransport); + ADDFN(CLiftindicator, CLift); + ADDFN(CPellerator, CTransport); + ADDFN(CServiceElevator, CTransport); - ADDFN(CAutoMusicPlayer, CAutoMusicPlayerBase); + ADDFN(CMusicPlayer, CGameObject); ADDFN(CAutoMusicPlayerBase, CGameObject); ADDFN(CAutoSoundPlayer, CGameObject); - ADDFN(CAutoSoundPlayerADSR, CAutoSoundPlayer); ADDFN(CBackgroundSoundMaker, CGameObject); - ADDFN(CBirdSong, CRoomAutoSoundPlayer); - ADDFN(CDomeFromTopOfWell, CViewAutoSoundPlayer); ADDFN(CGondolierSong, CGameObject); - ADDFN(CEnterViewTogglesOtherMusic, CTriggerAutoMusicPlayer); - ADDFN(CGondolierSong, CRoomAutoSoundPlayer); - ADDFN(CMusicPlayer, CGameObject); + ADDFN(CTriggerAutoMusicPlayer, CGameObject); + ADDFN(CMusicConsoleButton, CMusicPlayer); + ADDFN(CPhonograph, CMusicPlayer); + ADDFN(CRestaurantPhonograph, CPhonograph); + ADDFN(CMusicRoomPhonograph, CRestaurantPhonograph); + ADDFN(CEjectPhonographButton, CBackground); + ADDFN(CMusicRoomStopPhonographButton, CEjectPhonographButton); + ADDFN(CAutoMusicPlayer, CAutoMusicPlayerBase); + ADDFN(CAutoSoundPlayerADSR, CAutoSoundPlayer); ADDFN(CNodeAutoSoundPlayer, CAutoSoundPlayer); - ADDFN(CRestrictedAutoMusicPlayer, CAutoMusicPlayer); + ADDFN(CViewAutoSoundPlayer, CAutoSoundPlayer); ADDFN(CRoomAutoSoundPlayer, CAutoSoundPlayer); + ADDFN(CRestrictedAutoMusicPlayer, CAutoMusicPlayer); ADDFN(CRoomTriggerAutoMusicPlayer, CTriggerAutoMusicPlayer); + ADDFN(CEnterViewTogglesOtherMusic, CTriggerAutoMusicPlayer); + ADDFN(CViewTogglesOtherMusic, CEnterViewTogglesOtherMusic); + ADDFN(CWaterLappingSounds, CRoomAutoSoundPlayer); + ADDFN(CBirdSong, CRoomAutoSoundPlayer); + ADDFN(CDomeFromTopOfWell, CViewAutoSoundPlayer); + ADDFN(CGondolierSong, CRoomAutoSoundPlayer); ADDFN(CSeasonNoises, CViewAutoSoundPlayer); ADDFN(CSeasonalMusicPlayer, CAutoMusicPlayerBase); ADDFN(CAutoMusicPlayer, CAutoMusicPlayerBase); ADDFN(CAutoMusicPlayerBase, CAutoMusicPlayer); ADDFN(CTitaniaSpeech, CGameObject); - ADDFN(CTriggerAutoMusicPlayer, CGameObject); - ADDFN(CViewAutoSoundPlayer, CAutoSoundPlayer); - ADDFN(CViewTogglesOtherMusic, CEnterViewTogglesOtherMusic); - ADDFN(CWaterLappingSounds, CRoomAutoSoundPlayer); ADDFN(CStarControl, CGameObject); ADDFN(CTimeEventInfo, ListItem); } -- cgit v1.2.3